package com.aspose.cells;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

final class zia {
   public static int a = 10;
   public static int b = 8;
   public static int c = 14;

   static void a(zig var0) throws Exception {
      zn var1 = var0.ap();
      zbcs var2 = var0.z();
      if (var0.z().getCount() != 0 && a(var0.z().i()) != 0) {
         String var3 = c(var0);
         if (!"".equals(var3)) {
            throw new IllegalArgumentException(var3);
         } else {
            zbcs var4 = new zbcs(var0);
            zbcs var5 = new zbcs(var0);
            Iterator var6 = var2.iterator();

            zbcq var7;
            while(var6.hasNext()) {
               var7 = (zbcq)var6.next();
               if (var7.ag() == 1) {
                  var4.a(var7);
               } else {
                  var5.a(var7);
               }
            }

            zbcq var57 = var4.c(0);
            var7 = new zbcq(var0, (zbcs)null, 14);
            if (var5.getCount() > 0) {
               var7 = var5.c(0);
            }

            a(var0, var4, var5);
            boolean var8 = a(var57.ah());
            boolean var9 = a(var7.ah());
            boolean var10 = c(var4);
            boolean var11 = c(var5);
            if (a(var0.g(), var10, var11)) {
               if (var8 == var9) {
                  a(var2, var0.e());
                  var0.g().p = var0.e().p;
                  if (!var0.e().f() && var0.g().f()) {
                     var0.e().u = true;
                     var0.g().u = true;
                  }

                  var0.g().a(var0.e().f());
                  var0.g().r = true;
                  var0.e().r = true;
               } else {
                  a(var4, var0.e());
                  a(var5, var0.g());
               }
            } else {
               a(var4, var0.e());
               a(var5, var0.g());
            }

            if (var0.A().a().getCount() > 0) {
               var0.z().b = true;
            }

            if (var0.A().b().getCount() > 0) {
               var0.z().c = true;
            }

            var0.z().a(a(var0.z().a()));
            var0.z().b(a(var0.z().b()));
            var0.z().a(b(var0.z().a()));
            var0.z().b(b(var0.z().b()));
            if (var0.g().r) {
               a(var0.h(), var0.f());
               n(var0);
            }

            e(var0);
            zbuj.a(var0.e(), var0.z().c(), var4);
            zbuj.a(var0.g(), var0.z().d(), var5);
            zjl.a(var0.e(), var0.G(), var4, var57);
            zjl.a(var0.g(), var0.I(), var5, var7);
            a(var0, var8, var9);
            boolean var12 = zald.a(var0);
            var0.x().b = var12;
            d(var0);
            com.aspose.cells.b.a.b.zp var13 = new com.aspose.cells.b.a.b.zp(a + var0.ak().c(), a + var0.ak().d(), var0.ak().e() - a * 2, var0.ak().f() - a * 2);
            var0.i = new com.aspose.cells.b.a.b.zp(0, 0, var0.ak().e() - b / 2, var0.ak().f() - b / 2);
            if (var0.M().l()) {
               float var14 = 0.81F;
               if (var0.M().e().h().h() > 20.0F) {
                  var14 = 0.85F;
               }

               com.aspose.cells.b.a.b.zt var15 = new com.aspose.cells.b.a.b.zt((float)var0.a() * var14, (float)var0.b() * 0.5F);
               com.aspose.cells.b.a.b.zs var16 = var0.M().a(var15);
               var0.M().e().b.a((var0.a() - var16.b()) / 2);
               var0.M().e().b.b(var0.ak().d() + a);
               var0.M().e().b.a(var16);
               if (!var0.L().c()) {
                  var13.b(var13.d() + var16.c() + b);
                  var13.d(var13.f() - (var16.c() + b));
                  var0.i.b(var0.i.d() + var16.c() + a);
                  var0.i.d(var0.i.f() - (var16.c() + a));
               }
            }

            if (var0.v()) {
               if (var5.getCount() == 0 && (var57.ah() == 44 || var57.ah() == 35 || var12)) {
                  zbcq var59 = var57;
                  if (var57.m() == 35 || var57.m() == 36) {
                     for(int var60 = 1; var60 < var0.z().getCount(); ++var60) {
                        if (var0.z().a(var60).k() != null && var59.E() != null && var0.z().a(var60).k().getCount() > var59.E().getCount()) {
                           var59 = var0.z().c(var60);
                        }
                     }
                  }

                  com.aspose.cells.b.a.b.zp[] var62;
                  if ((var57.ah() != 35 || var57.I() || var4.getCount() <= 1) && !h(var0)) {
                     a(var0, var59);
                     var62 = new com.aspose.cells.b.a.b.zp[]{var13};
                     zald.a(var1, var0.x(), var59, var62);
                     var13 = var62[0];
                  } else {
                     g(var0);
                     var62 = new com.aspose.cells.b.a.b.zp[]{var13};
                     zald.a(var1, var0.x(), var62);
                     var13 = var62[0];
                  }
               } else {
                  g(var0);
                  com.aspose.cells.b.a.b.zp[] var58 = new com.aspose.cells.b.a.b.zp[]{var13};
                  zald.a(var1, var0.x(), var58);
                  var13 = var58[0];
               }
            }

            var0.a(new com.aspose.cells.b.a.b.zt((float)var13.e(), (float)var13.f()));
            com.aspose.cells.b.a.b.zt var61;
            com.aspose.cells.b.a.b.zp[] var63;
            com.aspose.cells.b.a.b.zs var64;
            if (var0.e().S().l()) {
               a(var0.e(), var8);
               new com.aspose.cells.b.a.b.zt();
               if (var8) {
                  var61 = new com.aspose.cells.b.a.b.zt((float)var0.a() * 0.2F, (float)var0.b() * 0.8F);
               } else {
                  var61 = new com.aspose.cells.b.a.b.zt((float)var0.a() * 0.8F, (float)var0.b() * 0.2F);
               }

               var64 = var0.e().S().a(var61);
               if (var0.G().u() == 1 && !var0.G().p()) {
                  var0.e().n = false;
               } else if (var0.G().u() != 1 && var0.G().p()) {
                  var0.e().n = false;
               }

               var63 = new com.aspose.cells.b.a.b.zp[]{var13};
               a(var0.e(), var63, var8, var64);
               var13 = var63[0];
            }

            if (var0.G().S().l()) {
               a(var0.G(), var8);
               new com.aspose.cells.b.a.b.zt();
               if (var8) {
                  var61 = new com.aspose.cells.b.a.b.zt((float)var0.a() * 0.8F, (float)var0.b() * 0.2F);
               } else {
                  var61 = new com.aspose.cells.b.a.b.zt((float)var0.a() * 0.2F, (float)var0.b() * 0.8F);
               }

               var64 = var0.G().S().a(var61);
               if (var0.e().u() == 1 && !var0.e().p()) {
                  var0.G().n = false;
               } else if (var0.e().u() != 1 && var0.e().p()) {
                  var0.G().n = false;
               }

               var63 = new com.aspose.cells.b.a.b.zp[]{var13};
               a(var0.G(), var63, var8, var64);
               var13 = var63[0];
            }

            if (var0.g().S().l() && var5.getCount() > 0) {
               a(var0.g(), var9);
               new com.aspose.cells.b.a.b.zt();
               if (var8) {
                  var61 = new com.aspose.cells.b.a.b.zt((float)var0.a() * 0.2F, (float)var0.b() * 0.8F);
               } else {
                  var61 = new com.aspose.cells.b.a.b.zt((float)var0.a() * 0.8F, (float)var0.b() * 0.2F);
               }

               var64 = var0.g().S().a(var61);
               if (var8 == var9) {
                  var0.g().n = !var0.e().n;
               } else {
                  var0.g().n = !var0.G().n;
               }

               var63 = new com.aspose.cells.b.a.b.zp[]{var13};
               a(var0.g(), var63, var9, var64);
               var13 = var63[0];
            }

            if (var0.I().S().l() && var5.getCount() > 0) {
               a(var0.I(), var9);
               new com.aspose.cells.b.a.b.zt();
               if (var8) {
                  var61 = new com.aspose.cells.b.a.b.zt((float)var0.a() * 0.8F, (float)var0.b() * 0.2F);
               } else {
                  var61 = new com.aspose.cells.b.a.b.zt((float)var0.a() * 0.2F, (float)var0.b() * 0.8F);
               }

               var64 = var0.I().S().a(var61);
               if (var8 == var9) {
                  var0.I().n = !var0.G().n;
               } else {
                  var0.I().n = !var0.e().n;
               }

               var63 = new com.aspose.cells.b.a.b.zp[]{var13};
               a(var0.I(), var63, var9, var64);
               var13 = var63[0];
            }

            zald.a(var0.x(), var13);
            com.aspose.cells.b.a.b.zp var66 = new com.aspose.cells.b.a.b.zp(0, 0, var0.a(), var0.b());
            if (!var0.B().s()) {
               if (var0.B().o().d() < 0) {
                  var0.B().b(var0.B().m() + var0.B().o().d());
                  var0.B().d(0);
               }

               if (var0.B().o().c() < 0) {
                  var0.B().a(var0.B().l() + var0.B().o().c());
                  var0.B().c(0);
               }

               if (var0.B().l() + var0.B().i() > 4000) {
                  var0.B().a(4000 - var0.B().i());
               }

               if (var0.B().m() + var0.B().n() > 4000) {
                  var0.B().b(4000 - var0.B().n());
               }

               var13.a(var0.B().v());
               var13.b(var0.B().w());
               var13.c(var0.B().t());
               var13.d(var0.B().u());
               if (var13.i() > var0.a()) {
                  var13.c(var0.a() - var13.c());
               }

               if (var13.j() > var0.b()) {
                  var13.d(var0.b() - var13.d());
               }
            }

            var0.a(var13.c(), var13.d(), var13.e(), var13.f());
            var0.B().b = new com.aspose.cells.b.a.b.zp(var13.c(), var13.d(), var13.e(), var13.f());
            com.aspose.cells.b.a.b.zp var65 = new com.aspose.cells.b.a.b.zp(var13.c(), var13.d(), var13.e(), var13.f());
            new com.aspose.cells.b.a.b.zp(var13.c(), var13.d(), var13.e(), var13.f());
            boolean var17 = false;
            boolean var18 = a(var0.e()) || f(var0.N());
            int var19 = 0;
            int var21;
            if (!zbuk.a(var13) && var0.u()) {
               f(var0);
               if (!var8 && !var9 && !var18) {
                  var0.e().m = 0;
                  var0.f().f(2);
                  var0.f().h(2);
                  var0.g().m = 0;
                  var0.h().f(2);
                  var0.h().h(2);
                  var17 = true;
               }

               com.aspose.cells.b.a.b.zs var20 = zis.a(var1, var0.k());
               var0.k().a(var20);
               var21 = zis.a(var1, var0.k(), var13);
               var0.k().a(var21);
               var19 = var20.c() + var21;
               if (var0.B().s()) {
                  var13.a(var13.c() + var20.b());
                  var13.c(var13.e() - var20.b());
                  if (var19 - 2 < var13.f() - 20) {
                     var13.d(var13.f() - (var19 - 2));
                  } else {
                     var13.d(20);
                  }

                  if (var18) {
                     var0.k().a.a(var13.c());
                     var0.k().a.b(var13.j());
                     var0.k().a.c(var13.e());
                     var13.d(var13.f() - c);
                  }
               } else if (var0.D()) {
                  var0.e -= var20.b();
                  var0.g += var20.b();
                  var0.h += var19 - 2;
                  if (var18) {
                     var0.k().a.b(var13.j() + c);
                  }
               } else {
                  var13.a(var13.c() + var20.b());
                  var13.c(var13.e() - var20.b());
                  var13.d(var13.f() - (var19 - 2));
                  if (var18) {
                     var0.k().a.a(var13.c());
                     var0.k().a.b(var13.j());
                     var0.k().a.c(var13.e());
                     var13.d(var13.f() - c);
                  }
               }
            }

            int var67 = a(var4.i());
            var21 = a(var5.i());
            double var22 = 0.0D;
            double var24 = 0.0D;
            boolean var26 = false;
            double[] var28;
            boolean var33;
            if (a(var0, var4.i(), var5.i())) {
               zbp var27 = j(var0);
               var28 = new double[]{var22};
               double[] var29 = new double[]{var24};
               var26 = a(var4.i(), var5.i(), var28, var29, var27);
               var22 = var28[0];
               var24 = var29[0];
               var0.c = var22;
               var0.d = var24;
               var0.a = true;
               var0.b = var27;
            } else {
               double[] var68 = new double[]{var22};
               var28 = new double[]{var24};
               var26 = a(var4.i(), var68, var28, var0.G());
               var22 = var68[0];
               var24 = var28[0];
               if (var8 && var0.g().s) {
                  double var69 = 0.0D;
                  double var31 = 0.0D;
                  var33 = false;
                  double[] var34 = new double[]{var69};
                  double[] var35 = new double[]{var31};
                  var33 = c(var5.i(), var34, var35, var0.g());
                  var69 = var34[0];
                  var31 = var35[0];
                  if (var69 < var22) {
                     var22 = var69;
                  }

                  if (var31 > var24) {
                     var24 = var31;
                  }

                  if (var26 && !var33) {
                     var26 = false;
                  }

                  var0.g().t = true;
               }
            }

            boolean var32 = var0.G().O();
            var33 = var0.G().P();
            boolean var70 = var0.G().N();
            boolean var71 = var0.G().M();
            if (var0.a) {
               if (var0.b == var0.G()) {
                  a(var1, var0.G(), var24, var22, var26, var0.G().l, var57.ah(), var13, var8, var4.c(0));
               } else {
                  a(var1, var0.I(), var24, var22, var26, var0.I().l, var7.ah(), var13, var9, var5.c(0));
               }

               if (var57.at() && var7.at()) {
                  double var36 = 0.0D;
                  double var38 = 0.0D;
                  double[] var40 = new double[]{var36};
                  double[] var41 = new double[]{var38};
                  boolean var42 = a(var4.i(), var40, var41, var0.G());
                  var36 = var40[0];
                  var38 = var41[0];
                  a(var1, var0.G(), var38, var36, var42, var0.G().l, var57.ah(), var13, var8, var4.c(0));
                  var40[0] = var36;
                  var41[0] = var38;
                  var26 = a(var5.i(), var40, var41, var0.I());
                  var36 = var40[0];
                  var38 = var41[0];
                  a(var1, var0.I(), var38, var36, var42, var0.I().l, var7.ah(), var13, var9, var5.c(0));
                  d(var0.G());
                  d(var0.I());
               }

               zbp var72 = k(var0);
               a(var72, var0.b);
            } else {
               a(var1, var0.G(), var24, var22, var26, var0.G().l, var57.ah(), var13, var8, var4.c(0));
            }

            boolean var73 = var0.e().O();
            boolean var37 = var0.e().P();
            boolean var74 = var0.e().N();
            boolean var39 = var0.e().M();
            new zbcs(var0);
            if (var0.e().r) {
               a(var1, var0.e(), var0.e().l, var13, var57.ah(), var2, var8);
            } else {
               a(var1, var0.e(), var0.e().l, var13, var57.ah(), var4, var8);
            }

            if (d(var0.N())) {
               zdu.a(true, var1, var2, var13, var2.h(), var73, var37, var74, var39, var32, var33, var70, var71);
            }

            com.aspose.cells.b.a.b.zp[] var44;
            if (!zbuk.a(var13) && var57.ah() != 57 && var57.ah() != 59) {
               a(var0.G(), var0.e(), var4, var0);
               com.aspose.cells.b.a.b.zs var75 = zbr.a(var1, var0.G(), var57, var8);
               b(var0.G(), var8);
               new com.aspose.cells.b.a.b.zt();
               com.aspose.cells.b.a.b.zt var78;
               if (!var8) {
                  var78 = new com.aspose.cells.b.a.b.zt((float)var65.e(), (float)var65.f());
               } else {
                  var78 = new com.aspose.cells.b.a.b.zt((float)var65.e(), (float)var65.f());
               }

               com.aspose.cells.b.a.b.zs var43 = var0.G().T().a(var78);
               var44 = new com.aspose.cells.b.a.b.zp[]{var13};
               a(var0, var1, var0.G(), var75, var43, var44, var8);
               var13 = var44[0];
            }

            com.aspose.cells.b.a.b.zs var45;
            double var47;
            int var81;
            int var92;
            if (!zbuk.a(var13) && !var17 && var0.e().q() && var57.ah() != 57 && var57.ah() != 59) {
               a(var0.e(), var0.G(), var4, var0);
               zbcq var76 = a(var4);
               com.aspose.cells.b.a.b.zs var80 = zbr.a(var1, var0.e(), var13, var66, var67, var8, var76);
               var81 = (int)((double)(var0.e().J().k() + var0.e().aa() + var0.e().ab()) + 0.5D);
               if (var0.z().e() != null) {
                  var81 += var81 * var0.z().e().length;
               }

               if (var57.ah() == 60 || var57.ah() == 12) {
                  b(var0.e(), var8);
                  new com.aspose.cells.b.a.b.zt();
                  com.aspose.cells.b.a.b.zt var83;
                  if (var8) {
                     var83 = new com.aspose.cells.b.a.b.zt((float)var65.e(), (float)var65.f());
                  } else {
                     var83 = new com.aspose.cells.b.a.b.zt((float)var65.e(), (float)var65.f());
                  }

                  var45 = var0.e().T().a(var83);
                  var81 += var45.c();
               }

               var44 = new com.aspose.cells.b.a.b.zp[]{var13};
               a(var0, var1, var0.e(), var80, var81, var44, var8, var18);
               var13 = var44[0];
               if (var0.B().s() && var0.G().q() && var57.ah() != 57 && var57.ah() != 59) {
                  int var87 = a(var1, var0.G(), var8, var57, var13);
                  boolean var46 = false;
                  if (var8) {
                     var92 = var13.e();
                  } else {
                     var92 = var13.f();
                  }

                  if (var32 && var0.G().l.size() > 3 && var87 > var92 && var92 != 0) {
                     var47 = var0.G().z();
                     var0.G().l.clear();
                     var0.G().i(var32);
                     var0.G().j(var33);
                     var0.G().h(var70);
                     var0.G().g(var71);
                     a(var1, var0.G(), var24, var22, var26, var0.G().l, var57.ah(), var13, var8, var4.c(0));
                     if (var0.G().z() > var47) {
                        zbr.a(var1, var0.G(), var57, var8);
                     }
                  }
               }
            }

            if (var5.getCount() > 0) {
               double var77 = 0.0D;
               double var85 = 0.0D;
               if (var0.a) {
                  var77 = var0.c;
                  var85 = var0.d;
               } else {
                  double[] var89 = new double[]{var77};
                  double[] var95 = new double[]{var85};
                  boolean var96 = a(var5.i(), var89, var95, var0.I());
                  var77 = var89[0];
                  var85 = var95[0];
                  a(var1, var0.I(), var85, var77, var96, var0.I().l, var7.ah(), var13, var9, var5.c(0));
               }

               a(var0.I(), var5);
               if (var0.e().r) {
                  if (var7.ah() == 60 && var8) {
                     var0.g().l = var0.G().l;
                     var0.g().d(var0.G().z());
                     var0.g().f(var0.G().D());
                     var0.g().c(var0.G().x());
                     var0.g().e(var0.G().B());
                     var0.g().a(false);
                     var0.g().q = true;
                     var0.g().d(var0.e().k());
                  } else {
                     var0.g().l = var0.e().l;
                     var0.g().d(var0.e().z());
                     var0.g().f(var0.e().D());
                     var0.g().c(var0.e().x());
                     var0.g().e(var0.e().B());
                     var0.g().d(var0.e().k());
                     if (var0.e().k() == 2) {
                        var0.g().c(var0.e().j());
                        var0.g().g(var0.e().y());
                        var0.g().i(var0.e().C());
                     }
                  }
               } else if (var0.g().t) {
                  var0.g().l = var0.G().l;
                  var0.g().d(var0.G().z());
                  var0.g().f(var0.G().D());
                  var0.g().c(var0.G().x());
                  var0.g().e(var0.G().B());
               } else {
                  a(var1, var0.g(), var0.g().l, var13, var7.ah(), var5, var9);
               }

               a(var0.g(), var5);
               if (!zbuk.a(var13) && var0.I().q() && var7.ah() != 57 && var7.ah() != 59) {
                  a(var0.I(), var0.g(), var5, var0);
                  var45 = zbr.a(var1, var0.I(), var7, var9);
                  b(var0.I(), var9);
                  new com.aspose.cells.b.a.b.zt();
                  com.aspose.cells.b.a.b.zt var97;
                  if (!var9) {
                     var97 = new com.aspose.cells.b.a.b.zt((float)var65.e(), (float)var65.f());
                  } else {
                     var97 = new com.aspose.cells.b.a.b.zt((float)var65.e(), (float)var65.f());
                  }

                  com.aspose.cells.b.a.b.zs var98 = var0.I().T().a(var97);
                  if (var8 == var9) {
                     if (var0.I().m != 3 && var0.I().m == var0.G().m) {
                        var0.I().m = 0;
                     }
                  } else if (var0.I().m != 3 && var0.I().m == var0.e().m) {
                     var0.I().m = 0;
                  }

                  com.aspose.cells.b.a.b.zp[] var48 = new com.aspose.cells.b.a.b.zp[]{var13};
                  a(var0, var1, var0.I(), var45, var98, var48, var9);
                  var13 = var48[0];
               }

               if (!zbuk.a(var13) && !var17 && var0.g().q() && var7.ah() != 57 && var7.ah() != 59) {
                  a(var0.g(), var0.I(), var5, var0);
                  var45 = zbr.a(var1, var0.g(), var13, var66, var21, var9, var7);
                  var92 = (int)((double)(var0.g().J().k() + var0.g().aa() + var0.g().ab()) + 0.5D);
                  if (var7.ah() == 60 || var7.ah() == 12) {
                     b(var0.e(), var9);
                     new com.aspose.cells.b.a.b.zt();
                     com.aspose.cells.b.a.b.zt var99;
                     if (var9) {
                        var99 = new com.aspose.cells.b.a.b.zt((float)var65.e(), (float)var65.f());
                     } else {
                        var99 = new com.aspose.cells.b.a.b.zt((float)var65.e(), (float)var65.f());
                     }

                     com.aspose.cells.b.a.b.zs var100 = var0.e().T().a(var99);
                     var92 += var100.c();
                  }

                  if (var8 == var9) {
                     if (var0.g().m != 3 && var0.g().m == var0.e().m) {
                        var0.g().m = 0;
                     }
                  } else if (var0.g().m != 3 && var0.g().m != 0 && var0.g().m == var0.G().m) {
                     var0.g().w = var0.G();
                  }

                  com.aspose.cells.b.a.b.zp[] var102 = new com.aspose.cells.b.a.b.zp[]{var13};
                  a(var0, var1, var0.g(), var45, var92, var102, var9, var18);
                  var13 = var102[0];
               }
            }

            float var79;
            float var82;
            if (!zbuk.a(var13) && var0.G().q() && var0.G().I() != 3 && var57.ah() != 57 && var57.ah() != 59) {
               zbr.b(var1, var0.G(), var57, var8);
               var79 = var0.G().j;
               var82 = var0.G().k;
               if (!var8) {
                  if (var0.B().s()) {
                     if ((float)(var13.d() - var65.d()) < var82) {
                        var81 = (int)(var82 - (float)(var13.d() - var65.d()));
                        var13.b(var13.d() + var81);
                        var13.d(var13.f() - var81);
                     }

                     if ((float)(var65.j() - var13.j()) < var79) {
                        var81 = (int)(var79 - (float)(var65.j() - var13.j()));
                        var13.d(var13.f() - var81);
                     }
                  } else {
                     if ((float)(var13.d() - var0.f) < var82) {
                        var81 = (int)(var82 - (float)(var13.d() - var0.f));
                        var0.f -= var81;
                        var0.h += var81;
                     }

                     if ((float)(var0.f + var0.h - var13.j()) < var79) {
                        var81 = (int)(var79 - (float)(var0.f + var0.h - var13.j()));
                        var0.h += var81;
                     }
                  }
               } else if (var0.B().s()) {
                  if ((float)(var13.c() - var65.c()) < var79) {
                     var81 = (int)(var79 - (float)(var13.c() - var65.c()));
                     var13.a(var13.c() + var81);
                     var13.c(var13.e() - var81);
                  }

                  if ((float)(var65.i() - var13.i()) < var82) {
                     var81 = (int)(var82 - (float)(var65.i() - var13.i()));
                     var13.c(var13.e() - var81);
                  }
               } else {
                  if ((float)(var13.c() - var0.e) < var79) {
                     var81 = (int)(var79 - (float)(var13.c() - var0.e));
                     var0.e -= var81;
                     var0.g += var81;
                  }

                  if ((float)(var0.e + var0.g - var13.i()) < var82) {
                     var81 = (int)(var82 - (float)(var0.e + var0.g - var13.i()));
                     var0.g += var81;
                  }
               }
            }

            if (!zbuk.a(var13) && var0.e().q() && var0.e().I() != 3 && var57.ah() != 57 && var57.ah() != 59 && (var0.e().j > 0.0F || var0.e().k > 0.0F)) {
               var79 = var0.e().j;
               var82 = var0.e().k;
               if (var8) {
                  if (var0.B().s()) {
                     if ((float)(var13.d() - var65.d()) < var82) {
                        var81 = (int)(var82 - (float)(var13.d() - var65.d()));
                        var13.b(var13.d() + var81);
                        var13.d(var13.f() - var81);
                     }

                     if ((float)(var65.j() - var13.j()) < var79) {
                        var81 = (int)(var79 - (float)(var65.j() - var13.j()));
                        var13.d(var13.f() - var81);
                     }
                  } else {
                     if ((float)(var13.d() - var0.f) < var82) {
                        var81 = (int)(var82 - (float)(var13.d() - var0.f));
                        var0.f -= var81;
                        var0.h += var81;
                     }

                     if ((float)(var0.f + var0.h - var13.j()) < var79) {
                        var81 = (int)(var79 - (float)(var0.f + var0.h - var13.j()));
                        var0.h += var81;
                     }
                  }
               } else if (var0.B().s()) {
                  if ((float)(var13.c() - var65.c()) < var79) {
                     var81 = (int)(var79 - (float)(var13.c() - var65.c()));
                     var13.a(var13.c() + var81);
                     var13.c(var13.e() - var81);
                  }

                  if ((float)(var65.i() - var13.i()) < var82) {
                     var81 = (int)(var82 - (float)(var65.i() - var13.i()));
                     var13.c(var13.e() - var81);
                  }
               } else {
                  if ((float)(var13.c() - var0.e) < var79) {
                     var81 = (int)(var79 - (float)(var13.c() - var0.e));
                     var0.e -= var81;
                     var0.g += var81;
                  }

                  if ((float)(var0.e + var0.g - var13.i()) < var82) {
                     var81 = (int)(var82 - (float)(var0.e + var0.g - var13.i()));
                     var0.g += var81;
                  }
               }
            }

            if (var5.getCount() > 0) {
               int var84;
               if (!zbuk.a(var13) && var0.B().s() && var0.I().q() && var0.I().I() != 3 && var7.ah() != 57 && var7.ah() != 59) {
                  if (!var9) {
                     var79 = var0.I().g / 2.0F;
                     if ((float)(var13.d() - var65.d()) < var79) {
                        var84 = (int)(var79 - (float)(var13.d() - var65.d()));
                        var13.b(var13.d() + var84);
                        var13.d(var13.f() - var84);
                     }

                     if ((float)(var65.j() - var13.j()) < var79) {
                        var84 = (int)(var79 - (float)(var65.j() - var13.j()));
                        var13.d(var13.f() - var84);
                     }
                  } else {
                     var79 = var0.I().f / 2.0F;
                     if ((float)(var13.c() - var65.c()) < var79) {
                        var84 = (int)(var79 - (float)(var13.c() - var65.c()));
                        var13.a(var13.c() + var84);
                        var13.c(var13.e() - var84);
                     }

                     if ((float)(var65.i() - var13.i()) < var79) {
                        var84 = (int)(var79 - (float)(var65.i() - var13.i()));
                        var13.c(var13.e() - var84);
                     }
                  }
               }

               if (!zbuk.a(var13) && var0.B().s() && var0.g().q() && var0.g().I() != 3 && var7.ah() != 57 && var7.ah() != 59 && (var0.g().j > 0.0F || var0.g().k > 0.0F)) {
                  if (var9) {
                     var79 = var0.g().g / 2.0F;
                     if ((float)(var13.d() - var65.d()) < var79) {
                        var84 = (int)(var79 - (float)(var13.d() - var65.d()));
                        var13.b(var13.d() + var84);
                        var13.d(var13.f() - var84);
                     }

                     if ((float)(var65.j() - var13.j()) < var79) {
                        var84 = (int)(var79 - (float)(var65.j() - var13.j()));
                        var13.d(var13.f() - var84);
                     }
                  } else {
                     var79 = var0.g().f / 2.0F;
                     if ((float)(var13.c() - var65.c()) < var79) {
                        var84 = (int)(var79 - (float)(var13.c() - var65.c()));
                        var13.a(var13.c() + var84);
                        var13.c(var13.e() - var84);
                     }

                     if ((float)(var65.i() - var13.i()) < var79) {
                        var84 = (int)(var79 - (float)(var65.i() - var13.i()));
                        var13.c(var13.e() - var84);
                     }
                  }
               }
            }

            if (!zbuk.a(var13)) {
               com.aspose.cells.b.a.b.zp[] var86 = new com.aspose.cells.b.a.b.zp[]{var13};
               a(var0, var86);
               var13 = var86[0];
               var0.a(new com.aspose.cells.b.a.b.zq((float)var13.c(), (float)var13.d(), (float)var13.e(), (float)var13.f()));
               var86[0] = var13;
               a(var1, var0, var57, var7, var86);
               var13 = var86[0];
            } else {
               var0.a(new com.aspose.cells.b.a.b.zq((float)var13.c(), (float)var13.d(), (float)var13.e(), (float)var13.f()));
            }

            var0.B().b = new com.aspose.cells.b.a.b.zp(var13.c(), var13.d(), var13.e(), var13.f());
            com.aspose.cells.b.a.b.zp var88 = new com.aspose.cells.b.a.b.zp(var0.e, var0.f, var0.g, var0.h);
            if (var0.D() && var0.u() && var18 && var19 != 0) {
               var88.d(var88.f() - (var19 - b));
            }

            if (!zbuk.a(var13) && !var0.B().s()) {
               if (var0.e().S().l()) {
                  a(var0.e(), var88, var8);
               }

               if (var0.g().S().l() && var5.getCount() > 0) {
                  a(var0.g(), var88, var9);
               }

               if (var0.G().S().l()) {
                  a(var0.G(), var88, var8);
               }

               if (var0.I().S().l() && var5.getCount() > 0) {
                  a(var0.I(), var88, var9);
               }
            }

            var0.B().z();
            com.aspose.cells.b.a.b.zp var94 = var0.B().a;
            if (!zbuk.a(var13) && var0.e().S().l()) {
               a(var0.e(), var8, var94);
            }

            if (!zbuk.a(var13) && var0.G().S().l()) {
               a(var0.G(), var8, var94);
            }

            if (!zbuk.a(var13) && var0.g().S().l() && var5.getCount() > 0) {
               a(var0.g(), var9, var94);
            }

            if (!zbuk.a(var13) && var0.I().S().l() && var5.getCount() > 0) {
               a(var0.I(), var9, var94);
            }

            boolean var90;
            int var91;
            if (var0.B().s() && var0.G().q() && var57.ah() != 57 && var57.ah() != 59) {
               var81 = a(var1, var0.G(), var8, var57, var13);
               var90 = false;
               if (var8) {
                  var91 = var13.e();
               } else {
                  var91 = var13.f();
               }

               if (var32 && var0.G().l.size() > 3 && var81 > var91 && var91 != 0) {
                  double var93 = var0.G().z();
                  var0.G().l.clear();
                  var0.G().i(var32);
                  var0.G().j(var33);
                  var0.G().h(var70);
                  var0.G().g(var71);
                  a(var1, var0.G(), var24, var22, var26, var0.G().l, var57.ah(), var13, var8, var4.c(0));
                  if (var0.G().z() > var93) {
                     zbr.a(var1, var0.G(), var57, var8);
                  }
               }
            }

            if (var0.B().s() && var0.e().q() && var57.ah() == 60) {
               var81 = a(var1, var0.e(), true, var57, var13);
               var90 = false;
               if (var8) {
                  var91 = var13.e();
               } else {
                  var91 = var13.f();
               }

               if (var73 && var0.e().l.size() > 3 && var81 > var91 && var91 != 0) {
                  var0.e().l.clear();
                  var0.e().i(var73);
                  var0.e().j(var37);
                  var0.e().h(var74);
                  var0.e().g(var39);
                  a(var1, var0.e(), var0.e().l, var13, var57.ah(), var4, var8);
               }
            }

            if (var8 && var32) {
               a(var0.G(), var24, var22, var0.N(), (float)var13.e(), var8, var2.c(0), var70, var71, var32);
            }

            if (d(var0.N())) {
               zdu.a(false, var1, var2, var13, var2.h(), var73, var37, var74, var39, var32, var33, var70, var71);
            }

            var0.B().z();
            var13 = var0.B().a;
            float var104 = a(var0.G(), var13.c(), var13.e(), var8);
            double var101 = var0.G().s();
            float var103 = a(var0.I(), var13.c(), var13.e(), var9);
            var47 = var0.I().s();
            float var49 = a(var0.G(), var13.d(), var13.f(), var8);
            float var50 = a(var0.I(), var13.d(), var13.f(), var9);
            float var51 = a(var0.e(), var13.d(), var13.f(), var8, var4);
            a(var0.g(), var13.d(), var13.f(), var9, var5);
            float var53 = 0.0F;
            float var54 = 0.0F;
            if (var57.ah() != 12 && var57.ah() != 60) {
               var53 = a(var0.e(), var13.c(), var13.e(), var8, var4);
            } else {
               var53 = a(var0.e(), var13.c(), var13.e(), !var8);
            }

            if (var7.ah() != 12 && var7.ah() != 60) {
               a(var0.g(), var13.c(), var13.e(), var9, var5);
            } else {
               var54 = a(var0.g(), var13.c(), var13.e(), !var9);
            }

            com.aspose.cells.b.a.b.zo var55;
            com.aspose.cells.b.a.b.zo var56;
            if (var8) {
               var55 = new com.aspose.cells.b.a.b.zo(var104, (float)var13.d());
               var56 = new com.aspose.cells.b.a.b.zo(var104, (float)var13.j());
               if (var0.e().p()) {
                  var0.e().a(var55);
                  var0.e().b(var56);
               } else {
                  var0.e().a(var56);
                  var0.e().b(var55);
               }
            } else {
               var55 = new com.aspose.cells.b.a.b.zo((float)var13.c(), var49);
               var56 = new com.aspose.cells.b.a.b.zo((float)var13.i(), var49);
               if (!var0.e().p()) {
                  var0.e().a(var55);
                  var0.e().b(var56);
               } else {
                  var0.e().a(var56);
                  var0.e().b(var55);
               }
            }

            if (var9) {
               var55 = new com.aspose.cells.b.a.b.zo(var104, (float)var13.d());
               var56 = new com.aspose.cells.b.a.b.zo(var104, (float)var13.j());
               if (var0.g().p()) {
                  var0.g().a(var55);
                  var0.g().b(var56);
               } else {
                  var0.g().a(var56);
                  var0.g().b(var55);
               }
            } else {
               var55 = new com.aspose.cells.b.a.b.zo((float)var13.c(), var49);
               var56 = new com.aspose.cells.b.a.b.zo((float)var13.i(), var49);
               if (!var0.g().p()) {
                  var0.g().a(var55);
                  var0.g().b(var56);
               } else {
                  var0.g().a(var56);
                  var0.g().b(var55);
               }
            }

            if (var8) {
               var55 = new com.aspose.cells.b.a.b.zo((float)var13.c(), var51);
               var56 = new com.aspose.cells.b.a.b.zo((float)var13.i(), var51);
               if (!var0.G().p()) {
                  var0.G().a(var55);
                  var0.G().b(var56);
               } else {
                  var0.G().a(var56);
                  var0.G().b(var55);
               }
            } else {
               var55 = new com.aspose.cells.b.a.b.zo(var53, (float)var13.d());
               var56 = new com.aspose.cells.b.a.b.zo(var53, (float)var13.j());
               if (var0.G().p()) {
                  var0.G().a(var55);
                  var0.G().b(var56);
               } else {
                  var0.G().a(var56);
                  var0.G().b(var55);
               }
            }

            if (var9) {
               var55 = new com.aspose.cells.b.a.b.zo((float)var13.c(), var51);
               var56 = new com.aspose.cells.b.a.b.zo((float)var13.i(), var51);
               if (!var0.I().p()) {
                  var0.I().a(var55);
                  var0.I().b(var56);
               } else {
                  var0.I().a(var56);
                  var0.I().b(var55);
               }
            } else {
               var55 = new com.aspose.cells.b.a.b.zo(var53, (float)var13.d());
               var56 = new com.aspose.cells.b.a.b.zo(var53, (float)var13.j());
               if (var0.I().p()) {
                  var0.I().a(var55);
                  var0.I().b(var56);
               } else {
                  var0.I().a(var56);
                  var0.I().b(var55);
               }
            }

            i(var0);
            var0.j = true;
         }
      }
   }

   static void b(zig var0) throws Exception {
      if (!var0.j) {
         a(var0);
      }

      int var1 = var0.ap().j();
      zbty.a(var0);
      zn var2 = var0.ap();
      zbcs var3 = var0.z();
      if (var0.z().getCount() != 0 && a(var0.z().i()) != 0) {
         zbcs var4 = new zbcs(var0);
         zbcs var5 = new zbcs(var0);
         Iterator var6 = var3.iterator();

         zbcq var7;
         while(var6.hasNext()) {
            var7 = (zbcq)var6.next();
            if (var7.ag() == 1) {
               var4.a(var7);
            } else {
               var5.a(var7);
            }
         }

         zbcq var44 = var4.c(0);
         var7 = new zbcq(var0, (zbcs)null, 14);
         if (var5.getCount() > 0) {
            var7 = var5.c(0);
         }

         boolean var8 = a(var44.ah());
         boolean var9 = a(var7.ah());
         int var10 = a(var4.i());
         int var11 = a(var5.i());
         if (var0.e().r) {
            ;
         }

         boolean var12 = var0.B().E();
         var0.B().G();
         com.aspose.cells.b.a.b.zp var13 = var0.B().a;
         float var14 = a(var0.G(), var13.c(), var13.e(), var8);
         double var15 = var0.G().s();
         float var17 = a(var0.I(), var13.c(), var13.e(), var9);
         double var18 = var0.I().s();
         float var20 = a(var0.G(), var13.d(), var13.f(), var8);
         float var21 = a(var0.I(), var13.d(), var13.f(), var9);
         float var22 = a(var0.e(), var13.d(), var13.f(), var8, var4);
         float var23 = a(var0.g(), var13.d(), var13.f(), var9, var5);
         float var24 = 0.0F;
         float var25 = 0.0F;
         if (var44.ah() != 12 && var44.ah() != 60) {
            var24 = a(var0.e(), var13.c(), var13.e(), var8, var4);
         } else {
            var24 = a(var0.e(), var13.c(), var13.e(), !var8);
         }

         if (var7.ah() != 12 && var7.ah() != 60) {
            var25 = a(var0.g(), var13.c(), var13.e(), var9, var5);
         } else {
            var25 = a(var0.g(), var13.c(), var13.e(), !var9);
         }

         if (var44.ah() != 57 && var44.ah() != 59) {
            zbr.a(var2, var0.e(), var13, var8, var44);
            zbr.a(var2, var0.G(), var13, var8, var44);
         } else {
            zbr.a(var2, var0.G(), var13, var10);
         }

         if (var7.ah() != 57 && var7.ah() != 59) {
            zbr.a(var2, var0.g(), var13, var9, var7);
            zbr.a(var2, var0.I(), var13, var9, var7);
         } else {
            zbr.a(var2, var0.I(), var13, var11);
         }

         boolean var26 = false;
         float var27 = 0.0F;
         float var28 = 0.0F;
         float var29 = 0.0F;
         float var30 = 0.0F;
         double var31 = 0.0D;
         ArrayList var33 = var3.k();
         zbcq var34 = (zbcq)((zbcq)var33.get(0));
         ArrayList var35 = new ArrayList();
         ArrayList var36 = new ArrayList();
         ArrayList var37 = new ArrayList();
         ArrayList var38 = new ArrayList();
         boolean var39 = false;
         boolean var40 = false;

         int var41;
         zbcq var42;
         for(var41 = 0; var41 < var33.size() && !var12; ++var41) {
            var42 = (zbcq)var33.get(var41);
            int var45;
            if (var42.ag() == 1) {
               var45 = var10;
               var27 = var14;
               var31 = var15;
               var28 = var20;
            } else {
               var45 = var11;
               var27 = var17;
               var31 = var18;
               var28 = var21;
            }

            if (var0.a) {
               if (var0.G() == var0.b) {
                  var27 = var14;
                  var31 = var15;
                  var28 = var20;
               } else {
                  var27 = var17;
                  var31 = var18;
                  var28 = var21;
               }
            }

            ArrayList var43;
            if (var42.a(new int[]{14})) {
               var43 = zkr.a(var2, var42, var13, var28, var31, var45);
               com.aspose.cells.b.a.a.ze.a(var35, (Collection)var43);
            } else if (var42.a(new int[]{15})) {
               var43 = zkr.a(var2, var42, var13, var45);
               com.aspose.cells.b.a.a.ze.a(var35, (Collection)var43);
            } else if (var42.a(new int[]{16})) {
               var43 = zkr.b(var2, var42, var13, var45);
               com.aspose.cells.b.a.a.ze.a(var35, (Collection)var43);
            } else if (var42.a(new int[]{37, 40})) {
               var43 = zkr.b(var2, var42, var13, var28, var31, var45);
               com.aspose.cells.b.a.a.ze.a(var36, (Collection)var43);
            } else if (var42.a(new int[]{38, 41})) {
               var43 = zkr.a(var2, var42, var13, var28, var45);
               com.aspose.cells.b.a.a.ze.a(var36, (Collection)var43);
            } else if (var42.a(new int[]{39, 42})) {
               var43 = zkr.b(var2, var42, var13, var28, var45);
               com.aspose.cells.b.a.a.ze.a(var36, (Collection)var43);
            } else if (var42.a(new int[]{6})) {
               var43 = zcf.a(var2, var0, var42, var13, var27, var31, var45);
               com.aspose.cells.b.a.a.ze.a(var37, (Collection)var43);
            } else if (var42.a(new int[]{7})) {
               var43 = zcf.a(var2, var0, var42, var13, var45);
               com.aspose.cells.b.a.a.ze.a(var37, (Collection)var43);
            } else if (var42.a(new int[]{8})) {
               var43 = zcf.b(var2, var0, var42, var13, var45);
               com.aspose.cells.b.a.a.ze.a(var37, (Collection)var43);
            } else if (var42.b(new int[]{60})) {
               var43 = zbvw.a(var2, var42, var13, var28, var31, var45);
               com.aspose.cells.b.a.a.ze.a(var36, (Collection)var43);
            } else if (var42.a(new int[]{0})) {
               var43 = zav.a(var2, var0, var42, var13, var28, var31, var45);
               com.aspose.cells.b.a.a.ze.a(var36, (Collection)var43);
            } else if (var42.a(new int[]{1})) {
               var43 = zav.a(var2, var0, var42, var13, var28, var45);
               com.aspose.cells.b.a.a.ze.a(var36, (Collection)var43);
            } else if (var42.a(new int[]{2})) {
               var43 = zav.b(var2, var0, var42, var13, var28, var45);
               com.aspose.cells.b.a.a.ze.a(var36, (Collection)var43);
            } else if (var42.b(new int[]{44}) && !var39) {
               zauf.a(var2, var13, var42);
               var39 = true;
            } else if (var42.b(new int[]{35}) && !var40) {
               zauf.a(var2, var13, var42);
               var40 = true;
            } else if (var42.b(new int[]{57, 59})) {
               var43 = zawc.a(var2, var42, var13, var45);
               com.aspose.cells.b.a.a.ze.a(var38, (Collection)var43);
            } else if (var42.a(new int[]{12, 13})) {
               var43 = zdu.a(var2, var42, var13, var28, var31, var45);
               com.aspose.cells.b.a.a.ze.a(var36, (Collection)var43);
            }
         }

         for(var41 = 0; var41 < var33.size(); ++var41) {
            var42 = (zbcq)var33.get(var41);
            zbuj.a(var2, var42.x(), var42.ah(), var13);
            zbuj.a(var2, var42.y(), var42.ah(), var13);
         }

         for(var41 = 0; var41 < var33.size(); ++var41) {
            var42 = (zbcq)var33.get(var41);
            if (var42.ag() == 1) {
               var27 = var14;
               var31 = var15;
               var28 = var20;
            } else {
               var27 = var17;
               var31 = var18;
               var28 = var21;
            }

            if (var42.G().getCount() > 0) {
               if (var42.ah() != 6 && var42.ah() != 7 && var42.ah() != 8) {
                  zbty.a(var2, var42, var13, var28, var31);
               } else {
                  zbty.b(var2, var42, var13, var27, var31);
               }
            }
         }

         zkr.a(var2, var0, var35);
         zkr.b(var2, var0, var36);
         zcf.a(var2, var0, var13, var37);
         zawc.a(var2, var0, var38);
         if (var0.M().l()) {
            var0.M().m();
         }

         if (var0.i().c().i() && var0.ap().j() != 4) {
            var0.ap().b(4);
         }

         zbcq var46;
         if (var44.at()) {
            zbr.a(var2, var4, var0.e(), var13);
         } else if (var0.e().q() && var44.ah() != 57 && var44.ah() != 59) {
            if (var8) {
               zbr.a(var2, var0.e(), var0.G().p(), var14, var13, var10);
            } else if ((var44.ah() == 60 || var44.ah() == 12) && "valAx".equals(var0.e().U())) {
               var46 = a(var4);
               zbr.c(var2, var0.e(), var0.G().p(), var20, var13, var46);
            } else {
               zbr.a(var2, var0.e(), var0.G().p(), var20, var13, var10, var8);
            }
         }

         if (var7.at()) {
            zbr.a(var2, var5, var0.g(), var13);
         } else if (var0.g().q() && var7.ah() != 57 && var7.ah() != 59) {
            if (var9) {
               zbr.a(var2, var0.g(), var0.I().p(), var17, var13, var11);
            } else if (var7.ah() != 60 && var7.ah() != 12) {
               zbr.a(var2, var0.g(), var0.I().p(), var21, var13, var11, var9);
            } else {
               var46 = a(var5);
               zbr.c(var2, var0.g(), var0.I().p(), var21, var13, var46);
            }
         }

         if (var0.G().q()) {
            if (var8) {
               zbr.b(var2, var0.G(), var0.e().p(), var22, var13, var44);
            } else if (var44.ah() != 57 && var44.ah() != 59) {
               zbr.a(var2, var0.G(), var0.e().p(), var24, var13, var44);
            } else {
               zbr.b(var2, var4, var0.G(), var13);
            }
         }

         if (var0.I().q()) {
            if (var9) {
               zbr.b(var2, var0.I(), var0.g().p(), var23, var13, var7);
            } else if (var7.ah() != 57 && var7.ah() != 59) {
               zbr.a(var2, var0.I(), var0.g().p(), var25, var13, var7);
            } else {
               zbr.b(var2, var5, var0.I(), var13);
            }
         }

         if (var0.i().c().i() && var0.ap().j() != var1) {
            var0.ap().b(var1);
         }

         if (var0.i().c().i() && var0.B().c().i() && var0.ap().j() != 4) {
            var0.ap().b(4);
         }

         for(var41 = 0; var41 < var33.size(); ++var41) {
            var42 = (zbcq)var33.get(var41);
            zbty.a(var2, var42);
         }

         if (var0.i().c().i() && var0.B().c().i() && var0.ap().j() != var1) {
            var0.ap().b(var1);
         }

         if (var0.e().S().l()) {
            var0.e().S().m();
         }

         if (var0.G().S().l()) {
            var0.G().S().m();
         }

         if (var0.g().S().l() && var5.getCount() > 0) {
            var0.g().S().m();
         }

         if (var0.I().S().l() && var5.getCount() > 0) {
            var0.I().S().m();
         }

         boolean var47;
         if (var0.u()) {
            var47 = a(var0.e()) || f(var0.N());
            if (var47) {
               var0.k().a.a(var0.B().a.c());
               var0.k().a.c(var0.B().a.e());
            } else {
               var0.k().a.a(var0.B().a.c());
               var0.k().a.b(var0.B().a.j());
               var0.k().a.c(var0.B().a.e());
            }

            zis.a(var2, var0.k(), var0.k().a.c(), var0.k().a.d(), var0.k().a.e(), var8);
         }

         var47 = var0.x().b;
         if (var0.v()) {
            if (var0.i().c().i() && var0.x().c().c().i() && var0.ap().j() != 4) {
               var0.ap().b(4);
            }

            if (var5.getCount() == 0 && (var44.ah() == 44 || var44.ah() == 35 || var47)) {
               var42 = var44;
               if (var44.m() == 35 || var44.m() == 36) {
                  for(int var48 = 1; var48 < var0.z().getCount(); ++var48) {
                     if (var0.z().a(var48).k() != null && var42.E() != null && var0.z().a(var48).k().getCount() > var42.E().getCount()) {
                        var42 = var0.z().c(var48);
                     }
                  }
               }

               if ((var44.ah() != 35 || var44.I() || var4.getCount() <= 1) && !h(var0)) {
                  zald.a(var2, var0.x(), var42);
               } else {
                  zald.a(var2, var0.x(), var8, var44);
               }
            } else {
               zald.a(var2, var0.x(), var8, var44);
            }

            if (var0.i().c().i() && var0.x().c().c().i() && var0.ap().j() != var1) {
               var0.ap().b(var1);
            }
         }

         var0.i().d().a(var0.i().a);
      }
   }

   private static zbcq a(zbcs var0) {
      for(int var1 = 0; var1 < var0.getCount(); ++var1) {
         zbcq var2 = var0.c(var1);

         for(int var3 = 0; var3 < var2.k().getCount(); ++var3) {
            if (!var2.k().a(var3).a()) {
               return var2;
            }
         }
      }

      return var0.c(0);
   }

   private static boolean h(zig var0) {
      boolean var1 = false;
      boolean var2 = false;

      for(int var3 = 1; var3 < var0.z().getCount(); ++var3) {
         if (var0.z().c(var3).b(new int[]{44})) {
            var1 = true;
         }

         if (var0.z().c(var3).b(new int[]{35})) {
            var2 = true;
         }
      }

      return var1 && var2;
   }

   static String c(zig var0) {
      zbcs var1 = var0.z();
      zbcs var2 = new zbcs(var0);
      zbcs var3 = new zbcs(var0);
      Iterator var4 = var1.iterator();

      zbcq var5;
      while(var4.hasNext()) {
         var5 = (zbcq)var4.next();
         if (var5.ag() == 1) {
            var2.a(var5);
         } else {
            var3.a(var5);
         }
      }

      if (var2.getCount() == 0) {
         return "Plot series are all on secondary axis. Must set one or more of Plot series on primary axis!";
      } else {
         b(var1);
         new zbcq(var0, (zbcs)null, 14);
         if (var3.getCount() > 0) {
            zbcq var10 = var3.c(0);
         } else {
            var0.g().d(false);
            var0.g().S().a("");
            var0.I().d(false);
            var0.I().S().a("");
            var5 = var2.c(0);
            boolean var6 = false;
            boolean var7 = false;

            int var8;
            zbcq var9;
            for(var8 = 0; var8 < var2.getCount(); ++var8) {
               var9 = var2.c(var8);
               if (var9.ah() != 44 && var9.ah() != 35) {
                  var7 = true;
               } else {
                  var6 = true;
               }
            }

            if (var6 && var7) {
               for(var8 = 0; var8 < var2.getCount(); ++var8) {
                  var9 = var2.c(var8);
                  if (var9.ah() == 44 || var9.ah() == 35) {
                     var9.n(2);
                     var3.a(var9);
                  }
               }
            }
         }

         return "";
      }
   }

   private static void b(zbcs var0) {
      Iterator var1 = var0.iterator();

      while(var1.hasNext()) {
         zbcq var2 = (zbcq)var1.next();
         var2.o(var2.m());
         switch(var2.m()) {
         case 0:
         case 14:
         case 37:
         case 40:
            var2.o(14);
            break;
         case 1:
         case 15:
         case 38:
         case 41:
            var2.o(15);
            break;
         case 2:
         case 16:
         case 39:
         case 42:
            var2.o(16);
         case 3:
         case 4:
         case 5:
         case 9:
         case 10:
         case 11:
         case 17:
         case 18:
         case 21:
         case 22:
         case 23:
         case 24:
         case 25:
         case 26:
         case 27:
         case 28:
         case 29:
         case 30:
         case 31:
         case 32:
         case 33:
         case 34:
         case 43:
         case 50:
         case 51:
         case 52:
         case 53:
         case 54:
         case 55:
         case 56:
         default:
            break;
         case 6:
            var2.o(6);
            break;
         case 7:
            var2.o(7);
            break;
         case 8:
            var2.o(8);
            break;
         case 12:
         case 13:
            var2.o(12);
            break;
         case 19:
            var2.o(19);
            break;
         case 20:
            var2.o(20);
            break;
         case 35:
         case 36:
         case 48:
            var2.o(35);
            break;
         case 44:
         case 45:
         case 46:
         case 47:
         case 49:
            var2.o(44);
            break;
         case 57:
         case 58:
            var2.o(57);
            break;
         case 59:
            var2.o(59);
            break;
         case 60:
         case 61:
         case 62:
         case 63:
         case 64:
            var2.o(60);
         }
      }

   }

   private static void a(zig var0, zbcs var1, zbcs var2) {
      zbcs var3 = var0.z();
      Iterator var4 = var3.iterator();

      while(var4.hasNext()) {
         zbcq var5 = (zbcq)var4.next();
         if (var5.ah() != 60 && var5.ah() != 12) {
            var5.y().a(2);
         }

         switch(var5.ah()) {
         case 35:
         case 44:
            if (var5.J()) {
               var5.c(true);
            }

            var0.c(false);
            if (var5.ag() == 1) {
               var0.e().d(false);
               var0.e().S().a("");
               var0.G().d(false);
               var0.G().S().a("");
               var0.e().w().a(0);
               var0.e().A().a(0);
               var0.G().w().a(0);
               var0.G().A().a(0);
            } else {
               var0.g().d(false);
               var0.g().S().a("");
               var0.I().d(false);
               var0.I().S().a("");
               var0.g().w().a(0);
               var0.g().A().a(0);
               var0.I().w().a(0);
               var0.I().A().a(0);
            }
            break;
         case 57:
         case 59:
            var0.c(false);
            if (var5.ag() == 1) {
               var0.e().d(1);
               var0.e().S().a("");
               var0.G().S().a("");
               var0.e().w().a(0);
               var0.e().A().a(0);
            } else {
               var0.g().d(1);
               var0.g().S().a("");
               var0.I().S().a("");
               var0.g().w().a(0);
               var0.g().A().a(0);
            }
         }
      }

      if (var0.e().r) {
         a(var3, var0.e());
         var0.g().p = var0.e().p;
         var0.g().a(var0.e().f());
      } else {
         a(var1, var0.e());
         a(var2, var0.g());
      }

   }

   private static boolean a(zbp var0, boolean var1, boolean var2) {
      if (var0.q()) {
         return false;
      } else if (!m(var0.e())) {
         return false;
      } else {
         return !var1 || var2;
      }
   }

   private static void a(zbcs var0, zbp var1) {
      boolean var2 = false;
      boolean var3 = false;
      Iterator var4 = var0.iterator();

      while(var4.hasNext()) {
         zbcq var5 = (zbcq)var4.next();
         if (var5.ah() == 60) {
            var2 = true;
         } else {
            var3 = true;
         }
      }

      if (var2 && !var3) {
         var1.a(false);
         var1.s = true;
      }

      if (var2 && var3) {
         var1.p = true;
      }

   }

   private static boolean c(zbcs var0) {
      boolean var1 = false;
      boolean var2 = false;
      Iterator var3 = var0.iterator();

      while(var3.hasNext()) {
         zbcq var4 = (zbcq)var3.next();
         if (var4.ah() == 60) {
            var1 = true;
         } else {
            var2 = true;
         }
      }

      if (var1 && !var2) {
         return true;
      } else {
         return false;
      }
   }

   private static void a(zalw var0, int var1) {
      if (var0.c() == 1) {
         zamg var2 = var0.f();
         var2.a((double)var1);
      }
   }

   static void d(zig var0) {
      zbcs var1 = var0.z();
      int var2 = var1.getCount();
      Color[] var3 = var0.Z().a().a(var0.R(), var1.n());
      Color var4 = var0.Z().a().a("lt1");
      Color var5 = var0.Z().a().a("dk1");

      for(int var6 = 0; var6 < var2; ++var6) {
         zbcq var7 = var1.c(var6);
         int var8 = var7.a();
         int var9 = var7.m();
         Color var10 = var3[var8];
         Color var11 = var3[var8];
         Color var12 = var11;
         var7.A().c(var10);
         int var25;
         if (var7.ak()) {
            var7.z().b(var11);
            if (var0.R() <= 8) {
               a(var7.z(), 3);
            } else if (var0.R() <= 24) {
               a(var7.z(), 5);
            } else if (var0.R() <= 32) {
               a(var7.z(), 7);
            } else if (var0.R() <= 48) {
               a(var7.z(), 5);
            }
         } else {
            if (var0.R() >= 9 && var0.R() <= 16) {
               var7.z().b(Color.a(255, (Color)a(var4)));
               a(var7.z(), 1);
            } else {
               Color var13;
               if (var0.R() == 33) {
                  var13 = var0.Z().a().a(var5, 0.925D);
                  var13 = Color.a(255, (Color)var13);
                  var7.z().b(var13);
                  a(var7.z(), 1);
               } else if (var0.R() == 34) {
                  var13 = var0.Z().a().b(var11, 0.5D);
                  var13 = Color.a(255, (Color)var13);
                  var7.z().b(var13);
                  a(var7.z(), 1);
               }
            }

            if (var0.R() >= 35 && var0.R() <= 40) {
               var25 = var0.R() - 34;
               Color var14 = var0.Z().a().a("accent" + var25);
               var14 = var0.Z().a().b(var14, 0.5D);
               var14 = Color.a(255, (Color)var14);
               var7.z().b(var14);
               a(var7.z(), 1);
            }
         }

         if (var7.ak()) {
            var7.B().f().b(var11);
            if (var0.R() <= 8) {
               var7.B().d(7);
            } else if (var0.R() <= 24) {
               var7.B().d(9);
            } else if (var0.R() <= 32) {
               var7.B().d(13);
            } else if (var0.R() <= 48) {
               var7.B().d(9);
            }

            var7.B().c(zald.a(var7, var8));
            var25 = var7.B().d();
            if (var25 != 5 && var25 != 6 && var25 != 8) {
               var7.B().e().c(var11);
            } else {
               var7.B().e().c(Color.getEmpty());
            }
         }

         zjg var26 = var7.E();
         int var27 = var26.getCount();
         Color[] var15 = var0.Z().a().a(var0.R(), var27);
         boolean var16 = false;
         if (var7.m() == 44 || var7.m() == 45 || var7.m() == 48 || var7.m() == 49 || var7.m() == 47 || var7.m() == 46 || var7.m() == 35 || var7.m() == 36) {
            var16 = true;
         }

         int var17 = var26.getCount();

         for(int var18 = 0; var18 < var17; ++var18) {
            zje var19 = var26.b(var18);
            if (var19 != null) {
               Color var20;
               Color var21;
               if (var16 && var7.I() || !var16 && var7.I() && var2 == 1) {
                  var20 = var15[var18];
                  var21 = var15[var18];
                  var19.i().c(var20);
                  int var29;
                  if (var7.ak()) {
                     var19.k().b(var21);
                     if (var0.R() <= 8) {
                        a(var19.k(), 3);
                     } else if (var0.R() <= 24) {
                        a(var19.k(), 5);
                     } else if (var0.R() <= 32) {
                        a(var19.k(), 7);
                     } else if (var0.R() <= 48) {
                        a(var19.k(), 5);
                     }
                  } else {
                     if (var0.R() >= 9 && var0.R() <= 16) {
                        var19.k().b(Color.a(255, (Color)a(var4)));
                        a(var19.k(), 1);
                     } else {
                        Color var23;
                        if (var0.R() == 33) {
                           var23 = var0.Z().a().a(var5, 0.925D);
                           var23 = Color.a(255, (Color)var23);
                           var19.k().b(var23);
                           a(var19.k(), 1);
                        } else if (var0.R() == 34) {
                           var23 = var0.Z().a().b(var11, 0.5D);
                           var23 = Color.a(255, (Color)var23);
                           var19.k().b(var23);
                           a(var19.k(), 1);
                        }
                     }

                     if (var0.R() >= 35 && var0.R() <= 40) {
                        var29 = var0.R() - 34;
                        Color var24 = var0.Z().a().a("accent" + var29);
                        var24 = var0.Z().a().b(var24, 0.5D);
                        var24 = Color.a(255, (Color)var24);
                        var19.k().b(var24);
                        a(var19.k(), 1);
                     }
                  }

                  if (var7.ak()) {
                     var19.m().f().b(var21);
                     if (var0.R() <= 8) {
                        var19.m().d(7);
                     } else if (var0.R() <= 24) {
                        var19.m().d(9);
                     } else if (var0.R() <= 32) {
                        var19.m().d(13);
                     } else if (var0.R() <= 48) {
                        var19.m().d(9);
                     }

                     var19.m().c(zald.a(var7, var18));
                     var29 = var19.m().d();
                     if (var29 != 5 && var29 != 6 && var29 != 8) {
                        var19.m().e().c(var21);
                     } else {
                        var19.m().e().c(Color.getEmpty());
                     }
                  }
               } else {
                  var19.i().c(var10);
                  int var28;
                  if (var7.ak()) {
                     var19.k().b(var11);
                     if (var0.R() <= 8) {
                        a(var19.k(), 3);
                     } else if (var0.R() <= 24) {
                        a(var19.k(), 5);
                     } else if (var0.R() <= 32) {
                        a(var19.k(), 7);
                     } else if (var0.R() <= 48) {
                        a(var19.k(), 5);
                     }
                  } else {
                     if (var0.R() >= 9 && var0.R() <= 16) {
                        var19.k().b(Color.a(255, (Color)a(var4)));
                        a(var19.k(), 1);
                     } else if (var0.R() == 33) {
                        var20 = var0.Z().a().a(var5, 0.925D);
                        var20 = Color.a(255, (Color)var20);
                        var19.k().b(var20);
                        a(var19.k(), 1);
                     } else if (var0.R() == 34) {
                        var20 = var0.Z().a().b(var11, 0.5D);
                        var20 = Color.a(255, (Color)var20);
                        var19.k().b(var20);
                        a(var19.k(), 1);
                     }

                     if (var0.R() >= 35 && var0.R() <= 40) {
                        var28 = var0.R() - 34;
                        var21 = var0.Z().a().a("accent" + var28);
                        var21 = var0.Z().a().b(var21, 0.5D);
                        var21 = Color.a(255, (Color)var21);
                        var19.k().b(var21);
                        a(var19.k(), 1);
                     }
                  }

                  if (var7.ak()) {
                     var19.m().f().b(var12);
                     if (var0.R() <= 8) {
                        var19.m().d(7);
                     } else if (var0.R() <= 24) {
                        var19.m().d(9);
                     } else if (var0.R() <= 32) {
                        var19.m().d(13);
                     } else if (var0.R() <= 48) {
                        var19.m().d(9);
                     }

                     var19.m().c(zald.a(var7, var8));
                     var28 = var19.m().d();
                     if (var28 != 5 && var28 != 6 && var28 != 8) {
                        var19.m().e().c(var12);
                     } else {
                        var19.m().e().c(Color.getEmpty());
                     }
                  }
               }
            }
         }
      }

   }

   private static Color a(Color var0) {
      zkh var1 = new zkh("r", var0.getR() & 255);
      zkh var2 = new zkh("g", var0.getG() & 255);
      zkh var3 = new zkh("b", var0.getB() & 255);
      if (var1.b() != 0 && var2.b() != 0 && var3.b() != 0) {
         ArrayList var4 = new ArrayList();
         com.aspose.cells.b.a.a.ze.a(var4, (Object)var1);
         com.aspose.cells.b.a.a.ze.a(var4, (Object)var2);
         com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
         Collections.sort(var4);
         zkh var5 = (zkh)var4.get(0);
         zkh var6 = (zkh)var4.get(1);
         zkh var7 = (zkh)var4.get(2);
         int var8 = var5.b();
         Iterator var9 = var4.iterator();

         while(var9.hasNext()) {
            zkh var10 = (zkh)var9.next();
            var10.b(var8 - var10.b());
         }

         byte var14 = 42;
         int var15 = var5.b() + var6.b() + var7.b();
         int var11 = var5.c() + var6.c() + var7.c();
         int var12 = zbuk.c((double)((float)var15 / (float)var14));
         if (var15 > 30) {
            int var13;
            if (var7.c() == 0) {
               var13 = zbuk.a((double)(var12 / 3));
               var5.a(var5.b() - var13);
               var6.a(var6.b() - var13);
               var7.a(var7.b() - var13);
            } else {
               var5.a(var5.b() - 1);
               --var12;
               if (var6.c() == 0) {
                  var6.a(var6.b() - 1);
                  --var12;
                  if (var12 > 0) {
                     var7.a(var7.b() - var12);
                  } else {
                     var7.a(var7.b() - 1);
                  }
               } else {
                  var13 = zbuk.a((double)((float)var6.c() / (float)var11 * (float)var12));
                  var6.a(var6.b() - var13);
                  var12 -= var13;
                  if (var12 > 0) {
                     var7.a(var7.b() - var12);
                  } else {
                     var7.a(var7.b() - 1);
                  }
               }
            }
         }
      }

      return Color.fromArgb(var1.b(), var2.b(), var3.b());
   }

   static void e(zig var0) {
      b(var0.e());
      b(var0.G());
      b(var0.g());
      b(var0.I());
      b(var0.K());
   }

   private static void b(zbp var0) {
      zbtk var1 = var0.J();
      var0.m(((int)var1.a().h() - 1) / 3 + 1);
      if (var1.a().h() < 6.0F) {
         var0.m((int)var1.a().h() / 2 + 1);
      }

      var0.n((int)((float)var0.aa() * 0.7F + 0.5F));
      if (var0.ab() == var0.aa()) {
         var0.n(var0.aa() - 1);
      }

      if (var0.ab() < 1) {
         var0.n(1);
      }

   }

   static boolean a(int var0) {
      switch(var0) {
      case 6:
      case 7:
      case 8:
      case 9:
      case 10:
      case 11:
      case 24:
      case 25:
      case 26:
      case 31:
      case 32:
      case 33:
      case 53:
      case 54:
      case 55:
         return true;
      case 12:
      case 13:
      case 14:
      case 15:
      case 16:
      case 17:
      case 18:
      case 19:
      case 20:
      case 21:
      case 22:
      case 23:
      case 27:
      case 28:
      case 29:
      case 30:
      case 34:
      case 35:
      case 36:
      case 37:
      case 38:
      case 39:
      case 40:
      case 41:
      case 42:
      case 43:
      case 44:
      case 45:
      case 46:
      case 47:
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      default:
         return false;
      }
   }

   private static void a(zbp var0, boolean var1) {
      zig var2 = var0.e();
      if (var0.g() == 1 || var0.g() == 3) {
         var1 = !var1;
      }

      if (var1 && var0.S().a) {
         var0.S().a(90);
      }

   }

   private static void b(zbp var0, boolean var1) {
      zig var2 = var0.e();
      if (var0.g() == 1 || var0.g() == 3) {
         var1 = !var1;
      }

      if (var1 && var0.T().a()) {
         var0.T().c(90);
      }

   }

   private static void a(zbp var0, com.aspose.cells.b.a.b.zp[] var1, boolean var2, com.aspose.cells.b.a.b.zs var3) {
      com.aspose.cells.b.a.b.zs var4 = new com.aspose.cells.b.a.b.zs(var3.b(), var3.c());
      zig var5 = var0.e();
      if (var0.g() == 1 || var0.g() == 3) {
         var2 = !var2;
      }

      if (var2) {
         if (var0.n) {
            var0.S().e().b.a(var1[0].c() + b / 2);
            var1[0].a(var1[0].c() + var4.b() + b);
            var1[0].c(var1[0].e() - (var4.b() + b));
         } else {
            var0.S().e().b.a(var1[0].i() - var4.b() - b / 2);
            var1[0].c(var1[0].e() - (var4.b() + b));
         }
      } else if (var0.n) {
         var0.S().e().b.b(var1[0].j() - var4.c() - b / 2);
         var1[0].d(var1[0].f() - (var4.c() + b));
      } else {
         var0.S().e().b.b(var1[0].d() + b / 2);
         var1[0].b(var1[0].d() + var4.c() + b);
         var1[0].d(var1[0].f() - (var4.c() + b));
      }

      var0.S().e().b.a(var4);
   }

   private static void a(zbp var0, com.aspose.cells.b.a.b.zp var1, boolean var2) throws Exception {
      com.aspose.cells.b.a.b.zs var3 = new com.aspose.cells.b.a.b.zs(var0.S().e().b.b().b(), var0.S().e().b.b().c());
      zig var4 = var0.e();
      if (var0.g() == 1 || var0.g() == 3) {
         var2 = !var2;
      }

      if (var2) {
         if (var0.n) {
            var0.S().e().b.a(var1.c() - var3.b());
            if (var0.S().e().b.c() < 0) {
               var0.S().e().b.a(0);
            }
         } else {
            var0.S().e().b.a(var1.i());
            if (var0.S().e().b.c() > var4.a() - var3.b()) {
               var0.S().e().b.a(var4.a() - var3.b());
            }
         }
      } else if (var0.n) {
         var0.S().e().b.b(var1.j());
         if (var0.S().e().b.d() > var4.b() - var3.c()) {
            var0.S().e().b.b(var4.b() - var3.c());
         }
      } else {
         var0.S().e().b.b(var1.d() - var3.c());
         if (var0.S().e().b.d() < 0) {
            var0.S().e().b.b(0);
         }
      }

      if (var0.S().e().b.c() < 0) {
         var0.S().e().b.a(0);
      } else if (var0.S().e().b.i() > var4.a()) {
         var0.S().e().c(var4.a() - var0.S().e().b.e());
      }

      if (var0.S().e().b.d() < 0) {
         var0.S().e().b.b(0);
      } else if (var0.S().e().b.j() > var4.b()) {
         var0.S().e().b.b(var4.b() - var0.S().e().b.f());
      }

   }

   private static void a(zbp var0, boolean var1, com.aspose.cells.b.a.b.zp var2) {
      zig var3 = var0.e();
      if (var0.g() == 1 || var0.g() == 3) {
         var1 = !var1;
      }

      if (var1) {
         var0.S().e().b.b(var2.d() + (var2.f() - var0.S().e().b.f()) / 2);
         if (var0.S().e().b.d() < var2.d()) {
            var0.S().e().b.b(var2.d());
         }
      } else {
         var0.S().e().b.a(var2.c() + (var2.e() - var0.S().e().b.e()) / 2);
         if (var0.S().e().b.c() < var2.c()) {
            var0.S().e().b.a(var2.c());
         }
      }

   }

   private static void i(zig var0) {
      c(var0.e());
      c(var0.g());
      c(var0.G());
      c(var0.I());
   }

   private static void c(zbp var0) {
      if (var0.a() == 1) {
         if (var0.n) {
            var0.b(0);
         } else {
            var0.b(1);
         }
      }

      if (var0.a() == 2) {
         if (var0.n) {
            var0.b(0);
         } else {
            var0.b(1);
         }
      }

      if (var0.a() == 0) {
         if (var0.n) {
            var0.b(3);
         } else {
            var0.b(2);
         }
      }

      if (var0.a() == 3) {
         if (var0.n) {
            var0.b(3);
         } else {
            var0.b(2);
         }
      }

   }

   static float a(zbp var0, int var1, int var2, boolean var3) {
      return a(var0, (float)var1, (float)var2, var3);
   }

   static float a(zbp var0, float var1, float var2, boolean var3) {
      float var4 = 0.0F;
      boolean var5;
      if (var3) {
         if (var0.p()) {
            var5 = false;
         } else {
            var5 = true;
         }
      } else if (var0.p()) {
         var5 = true;
      } else {
         var5 = false;
      }

      double var6 = var0.n() ? var0.g(var0.s()) : var0.s();
      double var8 = var0.n() ? var0.g(var0.z()) : var0.z();
      double var10 = var0.n() ? var0.g(var0.D()) : var0.D();
      if (var0.u() == 1) {
         var6 = var8;
      }

      if (var6 > var8) {
         var6 = var8;
      }

      if (var6 < var10) {
         var6 = var10;
      }

      var0.a(var0.n() ? var0.h(var6) : var6);
      if (!var5) {
         var4 = (float)((double)var1 + (var8 - var6) / (var8 - var10) * (double)var2);
      } else {
         var4 = (float)((double)var1 + (var6 - var10) / (var8 - var10) * (double)var2);
      }

      return var4;
   }

   static float a(zbp var0, int var1, int var2, boolean var3, zbcs var4) {
      return a(var0, (float)var1, (float)var2, var3, var4);
   }

   static float a(zbp var0, float var1, float var2, boolean var3, zbcs var4) {
      if (var4.getCount() == 0) {
         return 0.0F;
      } else {
         float var5 = 0.0F;
         boolean var6;
         if (var3) {
            if (var0.p()) {
               var6 = false;
            } else {
               var6 = true;
            }
         } else if (var0.p()) {
            var6 = true;
         } else {
            var6 = false;
         }

         zig var7 = var0.e();
         int var8;
         int var9;
         if (var0.k() != 2) {
            var8 = a(var4.i());
            var9 = var8;
            if (var0.f() || var7.u()) {
               var9 = var8 + 1;
            }

            byte var10 = 1;
            if (var9 <= var10) {
               var9 = 2;
            }

            double var11 = var0.s();
            if (var0.u() == 1) {
               var11 = (double)var9;
            }

            if (var11 > (double)var9) {
               var11 = (double)var9;
            } else if (var11 < (double)var10) {
               var11 = (double)var10;
            }

            if (var4.c(0).av()) {
               var11 = var0.n() ? var0.g(var0.s()) : var0.s();
               double var13 = var0.n() ? var0.g(var0.z()) : var0.z();
               double var15 = var0.n() ? var0.g(var0.D()) : var0.D();
               if (var0.u() == 1) {
                  var11 = var13;
               }

               if (var11 > var13) {
                  var11 = var13;
               }

               if (var11 < var15) {
                  var11 = var15;
               }

               var0.a(var0.n() ? var0.h(var11) : var11);
               if (var6) {
                  var5 = (float)((double)var1 + (var13 - var11) / (var13 - var15) * (double)var2);
               } else {
                  var5 = (float)((double)var1 + (var11 - var15) / (var13 - var15) * (double)var2);
               }
            } else {
               var0.a(var11);
               if (var6) {
                  var5 = (float)((double)var1 + ((double)var9 - var11) / (double)(var9 - var10) * (double)var2);
               } else {
                  var5 = (float)((double)var1 + (var11 - (double)var10) / (double)(var9 - var10) * (double)var2);
               }
            }
         } else {
            var8 = var0.j();
            var9 = (int)var0.z();
            int var17 = (int)var0.D();
            boolean var18 = false;
            int var19;
            if (!var0.f() && !var7.u()) {
               var19 = zbr.a(var8, var9, var17, var0.e().X());
               if (var19 == 0) {
                  var19 = 1;
               }
            } else {
               var9 = zbr.a(var8, var8, 1, var9, var7.X());
               var19 = zbr.a(var8, var9, var17, var0.e().X());
            }

            int var12 = zbr.a(var8, (int)var0.s(), var7.X());
            if (var0.u() == 1) {
               var12 = var9;
            }

            if (var12 > var9) {
               var12 = var9;
            } else if (var12 < var17) {
               var12 = var17;
            }

            var0.a((double)var12);
            if (var6) {
               var5 = var1 + var2 - (float)zbr.a(var8, var12, var17, var0.e().X()) / (float)var19 * var2;
            } else {
               var5 = var1 + (float)zbr.a(var8, var12, var17, var0.e().X()) / (float)var19 * var2;
            }
         }

         return var5;
      }
   }

   private static void a(zbp var0, zbp var1, zbcs var2, zig var3) {
      int var4 = var2.c(0).ah();
      switch(var0.I()) {
      case 0:
         var0.m = 2;
         if (var1.p()) {
            var0.m = 1;
         }
         break;
      case 1:
         var0.m = 1;
         if (var1.p()) {
            var0.m = 2;
         }
         break;
      case 2:
         var0.m = 3;
         if (var1.u() == 1) {
            if (!var1.p()) {
               var0.m = 2;
            } else {
               var0.m = 1;
            }
         } else if (var1.u() == 0) {
            if (var1.g() != 1 && var1.g() != 3) {
               if (var1.g() == 0 || var1.g() == 2) {
                  if (var4 != 60 && var4 != 12) {
                     var1.a(var1.D());
                  } else {
                     var1.a(0.0D);
                  }
               }
            } else {
               var1.a(0.0D);
            }
         }

         if (var1.u() == 2) {
            if (var1.k() != 2 && (var1.g() == 0 || var1.g() == 2) && var2.c(0).ah() != 12 && var2.c(0).ah() != 60) {
               int var10 = a(var2.i());
               int var6 = var10;
               if (var1.f() || var3.u()) {
                  var6 = var10 + 1;
               }

               byte var7 = 1;
               if (var6 <= var7) {
                  var6 = 2;
               }

               double var8 = var1.s();
               if (var1.u() == 1) {
                  var8 = (double)var6;
               }

               if (var8 > (double)var6) {
                  var8 = (double)var6;
               } else if (var8 < (double)var7) {
                  var8 = (double)var7;
               }

               if (!var1.p()) {
                  if (var8 == (double)var7) {
                     var0.m = 1;
                  }
               } else if (var8 == (double)var7) {
                  var0.m = 2;
               }
            } else {
               double var5 = var1.D();
               if (var1.s() <= var5) {
                  if (!var1.p()) {
                     var0.m = 1;
                  } else {
                     var0.m = 2;
                  }
               }
            }
         }
         break;
      case 3:
         var0.m = 0;
      }

   }

   private static void a(zig var0, zn var1, zbp var2, com.aspose.cells.b.a.b.zs var3, com.aspose.cells.b.a.b.zs var4, com.aspose.cells.b.a.b.zp[] var5, boolean var6) {
      if (var6) {
         switch(var2.m) {
         case 0:
         default:
            break;
         case 1:
            if (!var0.B().s() && (var0.C().s() || var0.D())) {
               var0.k().a.b(var0.k().a.d() + var3.c() + var4.c());
               var0.h += var3.c();
               if (var2.T().b().i() == 0 || var2.T().b().n() == 0) {
                  var0.h += var4.c();
               }
            } else {
               var5[0].d(var5[0].f() - var3.c());
               var5[0].d(var5[0].f() - var4.c());
            }
            break;
         case 2:
            if (var0.B().s() || !var0.C().s() && !var0.D()) {
               var5[0].b(var5[0].d() + var3.c());
               var5[0].d(var5[0].f() - var3.c());
               var5[0].b(var5[0].d() + var4.c());
               var5[0].d(var5[0].f() - var4.c());
            } else {
               var0.f -= var3.c();
               var0.h += var3.c();
               var0.f -= var4.c();
               if (var2.T().b().i() == 0 || var2.T().b().n() == 0) {
                  var0.h += var4.c();
               }
            }
            break;
         case 3:
            if (var0.B().s() && var0.u()) {
               var5[0].d(var5[0].f() - 5);
            }
         }

         var2.v = new com.aspose.cells.b.a.b.zs(var5[0].e(), var3.c() + var4.c());
      } else {
         switch(var2.m) {
         case 0:
         case 3:
         default:
            break;
         case 1:
            com.aspose.cells.b.a.b.zs var7;
            if (var0.B().s() || !var0.C().s() && !var0.D()) {
               if (!var0.u()) {
                  var5[0].a(var5[0].c() + var3.b());
                  var5[0].c(var5[0].e() - var3.b());
                  var5[0].a(var5[0].c() + var4.b());
                  var5[0].c(var5[0].e() - var4.b());
               } else {
                  var7 = var0.k().k();
                  if (var3.b() + var4.b() > var7.b()) {
                     var5[0].a(var5[0].c() + var3.b() + var4.b() - var7.b());
                     var5[0].c(var5[0].e() - (var3.b() + var4.b() - var7.b()));
                  }
               }
            } else if (!var0.u()) {
               var0.e -= var3.b();
               var0.g += var3.b();
               if (var2.T().b().i() == 0 || var2.T().b().n() == 0) {
                  var0.e -= var4.b();
                  var0.g += var4.b();
               }
            } else {
               var7 = var0.k().k();
               if (var2.T().b().i() != 0 && var2.T().b().n() != 0) {
                  if (var3.b() > var7.b()) {
                     var0.e -= var3.b() - var7.b();
                     var0.g += var3.b() - var7.b();
                  }
               } else if (var3.b() + var4.b() > var7.b()) {
                  var0.e -= var3.b() + var4.b() - var7.b();
                  var0.g += var3.b() + var4.b() - var7.b();
               }
            }
            break;
         case 2:
            if (var0.B().s() || !var0.C().s() && !var0.D()) {
               var5[0].c(var5[0].e() - var3.b());
               var5[0].c(var5[0].e() - var4.b());
            } else {
               var0.g += var3.b();
               if (var2.T().b().i() == 0 || var2.T().b().n() == 0) {
                  var0.g += var4.b();
               }
            }
         }

         var2.v = new com.aspose.cells.b.a.b.zs(var3.b() + var4.b(), var5[0].f());
      }

   }

   private static void a(zig var0, com.aspose.cells.b.a.b.zp[] var1) throws Exception {
      int var2 = var1[0].c() - var0.e;
      int var3 = var0.e + var0.g - var1[0].i();
      int var4 = var1[0].d() - var0.f;
      int var5 = var0.f + var0.h - var1[0].j();
      int var6;
      if (var0.e < 0) {
         var0.e = 0;
         var6 = var1[0].i();
         var1[0].a(var2);
         var1[0].c(var6 - var1[0].c());
      }

      if (var0.g > var0.a()) {
         var0.g = var0.a();
      }

      var6 = var0.a() - var3;
      if (var1[0].i() > var6) {
         var1[0].c(var6 - var1[0].c());
      }

      int var7;
      if (var0.f < 0) {
         var0.f = 0;
         var7 = var1[0].j();
         var1[0].b(var4);
         var1[0].d(var7 - var1[0].d());
      }

      if (var0.h > var0.b()) {
         var0.h = var0.b();
      }

      var7 = var0.b() - var5;
      if (var1[0].f() > var7) {
         var1[0].d(var7 - var1[0].d());
      }

   }

   private static void a(zig var0, zn var1, zbp var2, com.aspose.cells.b.a.b.zs var3, int var4, com.aspose.cells.b.a.b.zp[] var5, boolean var6, boolean var7) {
      com.aspose.cells.b.a.b.zp var8 = new com.aspose.cells.b.a.b.zp(var5[0].c(), var5[0].d(), var5[0].e(), var5[0].f());
      float var9 = 0.25F;
      if (var6) {
         switch(var2.m) {
         case 0:
         default:
            break;
         case 1:
            com.aspose.cells.b.a.b.zs var10;
            if (var0.B().s() || !var0.C().s() && !var0.D()) {
               if (!var0.u()) {
                  var5[0].a(var5[0].c() + var3.b() + var4);
                  var5[0].c(var5[0].e() - (var3.b() + var4));
               } else {
                  var10 = var0.k().k();
                  if (var3.b() + var4 > var10.b()) {
                     var5[0].a(var5[0].c() + var3.b() + var4 - var10.b());
                     var5[0].c(var5[0].e() - (var3.b() + var4 - var10.b()));
                  }
               }
            } else if (!var0.u()) {
               var0.e -= var3.b() + var4;
               var0.g += var3.b() + var4;
            } else {
               var10 = var0.k().k();
               if (var3.b() + var4 > var10.b()) {
                  var0.e -= var3.b() + var4 - var10.b();
                  var0.g += var3.b() + var4 - var10.b();
               }
            }
            break;
         case 2:
            if (!var0.B().s() && (var0.C().s() || var0.D())) {
               var0.g += var3.b() + var4;
               break;
            }

            var5[0].c(var5[0].e() - (var3.b() + var4));
            break;
         case 3:
            a(zbr.a(var2), var5, var6, var3, var4);
         }

         var2.v = new com.aspose.cells.b.a.b.zs(var3.b() + var4, var5[0].f());
         if (var5[0].e() < (int)((float)var8.e() * var9)) {
            var5[0].c((int)((float)var8.e() * var9));
         }
      } else {
         if (var0.u() && var2.k() != 2) {
            var2.m = 0;
            var2.f(2);
            var2.h(2);
            var4 = 0;
         }

         switch(var2.m) {
         case 0:
         default:
            break;
         case 1:
            if (!var0.B().s() && (var0.C().s() || var0.D())) {
               var0.h += var3.c() + var4;
               var0.k().a.b(var0.k().a.d() + var3.c() + var4);
            } else {
               var5[0].d(var5[0].f() - (var3.c() + var4));
            }
            break;
         case 2:
            if (var0.B().s() || !var0.C().s() && !var0.D()) {
               if (var0.u() && var2.k() == 2) {
                  var5[0].b(var5[0].d() + var3.c() + var4);
                  var5[0].d(var5[0].f() - (var3.c() + var4 + b));
               } else {
                  var5[0].b(var5[0].d() + var3.c() + var4);
                  var5[0].d(var5[0].f() - (var3.c() + var4));
                  if (var2.w != null) {
                     var5[0].d(var5[0].f() - var2.aa() * 10);
                  }
               }
            } else {
               if (var0.u() && var2.k() == 2) {
                  var0.f -= var3.c() + var4;
                  var0.h += var3.c() + var4 + b;
                  break;
               }

               var0.f -= var3.c() + var4;
               var0.h += var3.c() + var4;
            }
            break;
         case 3:
            if (var0.B().s() || !var0.C().s() && !var0.D()) {
               if (var0.u() && var2.k() == 2) {
                  var5[0].d(var5[0].f() - b);
               } else {
                  a(zbr.a(var2), var5, var6, var3, var4);
               }
            } else if (var0.u() && var2.k() == 2) {
               var0.h += b;
            } else {
               a(zbr.a(var2), var5, var6, var3, var4);
            }
         }

         var2.v = new com.aspose.cells.b.a.b.zs(var5[0].e(), var3.c() + var4);
         if (var5[0].f() < (int)((float)var8.f() * var9)) {
            var5[0].d((int)((float)var8.f() * var9));
         }
      }

   }

   static void a(zbp var0, com.aspose.cells.b.a.b.zp[] var1, boolean var2, com.aspose.cells.b.a.b.zs var3, int var4) {
      com.aspose.cells.b.a.b.zs var5 = com.aspose.cells.a.c.zn.a(var3);
      zig var6 = var0.e();
      var5.a(var5.b() + var4);
      var5.b(var5.c() + var4);
      float var7 = (float)var1[0].d();
      float var8 = (float)var1[0].f();
      if (var2) {
         var7 = (float)var1[0].c();
         var8 = (float)var1[0].e();
      }

      double var9 = var0.n() ? var0.g(var0.s()) : var0.s();
      double var11 = var0.n() ? var0.g(var0.z()) : var0.z();
      double var13 = var0.n() ? var0.g(var0.D()) : var0.D();
      if (var0.u() == 1) {
         var9 = var11;
      }

      if (var9 > var11) {
         var9 = var11;
      }

      if (var9 < var13) {
         var9 = var13;
      }

      float var15 = (float)((var9 - var13) / (var11 - var13) * (double)var8);
      int var16;
      com.aspose.cells.b.a.b.zp var17;
      int var18;
      if (var2) {
         var16 = 2;

         for(var17 = com.aspose.cells.a.c.zn.b(var1[0]); var16 > 0; --var16) {
            var1[0] = new com.aspose.cells.b.a.b.zp(var17.c(), var17.d(), var17.e(), var17.f());
            var18 = (int)((float)var5.b() - var15);
            if (var18 > 0) {
               if (var6.B().s()) {
                  if (var0.p()) {
                     var1[0].c(var1[0].e() - var18);
                  } else {
                     var1[0].a(var1[0].c() + var18);
                     var1[0].c(var1[0].e() - var18);
                  }
               } else if (var0.p()) {
                  var6.g += var18;
               } else {
                  var6.e -= var18;
                  var6.g += var18;
               }
            }

            var15 = (float)var1[0].e() * var15 / (float)var17.e();
         }
      } else {
         var16 = 2;

         for(var17 = com.aspose.cells.a.c.zn.b(var1[0]); var16 > 0; --var16) {
            var1[0] = new com.aspose.cells.b.a.b.zp(var17.c(), var17.d(), var17.e(), var17.f());
            var18 = (int)((float)var5.c() - var15);
            if (var18 > 0) {
               if (var6.B().s()) {
                  if (var0.p()) {
                     var1[0].b(var1[0].d() + var18);
                     var1[0].d(var1[0].f() - var18);
                  } else {
                     var1[0].d(var1[0].f() - var18);
                  }
               } else if (var0.p()) {
                  var6.f -= var18;
                  var6.h += var18;
               } else {
                  var6.h += var18;
               }
            }

            var15 = (float)var1[0].f() * var15 / (float)var17.f();
         }
      }

   }

   private static void a(zn var0, zig var1, zbcq var2, zbcq var3, com.aspose.cells.b.a.b.zp[] var4) throws Exception {
      if (!var2.as() && !var3.as()) {
         if (var2.at() || var3.at()) {
            com.aspose.cells.b.a.b.zt var17 = new com.aspose.cells.b.a.b.zt((float)var1.a() * 0.2F, (float)var1.b());
            boolean var18 = var1.e().I() != 3;
            boolean var20 = var1.g().I() != 3;
            if (!var1.B().s()) {
               if (var2.at() && var18) {
                  var1.e().f = var17.b();
                  var1.e().g = var17.c();
               }

               if (var3.at() && var20) {
                  var1.g().f = var17.b();
                  var1.g().g = var17.c();
               }
            } else {
               com.aspose.cells.b.a.b.zs var8 = com.aspose.cells.b.a.b.zs.a();
               int var21 = 0;
               int var10 = 0;
               int var12;
               com.aspose.cells.b.a.b.zg var14;
               int var15;
               com.aspose.cells.b.a.b.zs var16;
               com.aspose.cells.b.a.b.zs var22;
               String var23;
               if (var2.at() && var18) {
                  var1.e().f = var17.b();
                  var1.e().g = var17.c();
                  var22 = zbsq.a(var0, "a", var1.e().J().a());
                  var1.e().J().d(var22.b() / 2);
                  var21 = var1.e().J().k();

                  for(var12 = 0; var12 < var1.e().l.size(); ++var12) {
                     var23 = com.aspose.cells.b.a.zr.a(var1.e().l.get(var12));
                     var14 = var1.e().J().a();
                     var15 = var1.e().J().d();
                     var16 = zbsq.b(var1.ap(), var23, var15, var14, (com.aspose.cells.b.a.b.zt)var17, 1, 1);
                     if (var16.b() > var8.b()) {
                        var8.a(var16.b());
                     }

                     if (var16.c() > var8.c()) {
                        var8.b(var16.c());
                     }
                  }
               }

               if (var3.at() && var20) {
                  var1.g().f = var17.b();
                  var1.g().g = var17.c();
                  var22 = zbsq.a(var0, "a", var1.g().J().a());
                  var1.g().J().d(var22.b() / 2);
                  var10 = var1.g().J().k();

                  for(var12 = 0; var12 < var1.g().l.size(); ++var12) {
                     var23 = com.aspose.cells.b.a.zr.a(var1.g().l.get(var12));
                     var14 = var1.g().J().a();
                     var15 = var1.g().J().d();
                     var16 = zbsq.b(var1.ap(), var23, var15, var14, (com.aspose.cells.b.a.b.zt)var17, 1, 1);
                     if (var16.b() > var8.b()) {
                        var8.a(var16.b());
                     }

                     if (var16.c() > var8.c()) {
                        var8.b(var16.c());
                     }
                  }
               }

               if (!com.aspose.cells.b.a.b.zs.a(var8, com.aspose.cells.b.a.b.zs.a())) {
                  if (var21 < var10) {
                     var21 = var10;
                  }

                  var8.a(var8.b() + var21);
                  var8.b(var8.c() + var21);
               }

               var4[0].a(-var8.b(), -var8.c());
            }

            zbuk.a(var4);
            byte var19 = 15;
            if (var4[0].e() < var19) {
               var4[0].c(var19);
            }

            if (var4[0].f() < var19) {
               var4[0].d(var19);
            }
         }
      } else {
         int var5 = var2.m();
         int var6 = var3.m();
         double var7 = 75.0D;
         double var9 = 100.0D;
         zauf.a(var1, var4, var2);
         zauf.a(var1, var4, var3);
         double var11;
         double var13;
         if (var5 != 46 && var6 != 46) {
            if (var5 != 49 && var6 != 49) {
               zbuk.a(var4);
            } else {
               if (var5 == 49) {
                  var7 = (double)var2.X();
                  var9 = (double)var2.K() / 2.0D;
               }

               if (var6 == 49) {
                  var7 = (double)var3.X();
                  var9 = (double)var3.K() / 2.0D;
               }

               var11 = (double)var4[0].e() / (2.0D + var7 / 100.0D + var9 / 100.0D);
               if (var7 <= 100.0D) {
                  if (var11 > (double)var4[0].f() / 2.0D) {
                     var11 = (double)var4[0].f() / 2.0D;
                  }

                  var1.k(zbuk.c(var11));
                  var1.l(zbuk.c(var11 * var7 / 100.0D));
                  var1.m(zbuk.c(var11 * var9 / 100.0D));
               } else {
                  var13 = var7 * var11 / 100.0D;
                  if (var13 > (double)var4[0].f() / 2.0D) {
                     var13 = (double)var4[0].f() / 2.0D;
                  }

                  var1.l(zbuk.c(var13));
                  var1.k(zbuk.c(var13 * 100.0D / var7));
                  var1.m(zbuk.c(var13 * 100.0D / var7 * var9 / 100.0D));
               }
            }
         } else {
            if (var5 == 46) {
               var7 = (double)var2.X();
               var9 = (double)var2.K();
            }

            if (var6 == 46) {
               var7 = (double)var3.X();
               var9 = (double)var3.K();
            }

            var11 = (double)var4[0].e() / (2.0D + 2.0D * var7 / 100.0D + var9 / 100.0D);
            if (var7 <= 100.0D) {
               if (var11 > (double)var4[0].f() / 2.0D) {
                  var11 = (double)var4[0].f() / 2.0D;
               }

               var1.k(zbuk.c(var11));
               var1.l(zbuk.c(var11 * var7 / 100.0D));
               var1.m(zbuk.c(var11 * var9 / 100.0D));
            } else {
               var13 = var7 * var11 / 100.0D;
               if (var13 <= (double)var4[0].f() / 2.0D) {
                  var13 = (double)var4[0].f() / 2.0D;
               }

               var1.l(zbuk.c(var13));
               var1.k(zbuk.c(var13 * 100.0D / var7));
               var1.m(zbuk.c(var13 * 100.0D / var7 * var9 / 100.0D));
            }
         }
      }

   }

   private static void a(zbp var0, zbcs var1) {
      ArrayList var2 = var0.l;
      boolean var3;
      if (var0.g() != 1 && var0.g() != 3) {
         var3 = false;
      } else {
         var3 = true;
      }

      ArrayList var5 = var1.j();

      for(int var6 = 0; var6 < var5.size(); ++var6) {
         zbcq var7 = (zbcq)var5.get(var6);
         int var8 = var7.ah();
         zsq var4;
         if (var3) {
            var4 = var7.x();
         } else {
            var4 = var7.y();
         }

         if (var4 != null && var4.d() != 2) {
            for(int var9 = 0; var9 < var7.E().getCount(); ++var9) {
               zje var10 = var7.E().b(var9);
               double var11 = 0.0D;
               if (var3) {
                  var11 = var10.v();
               } else {
                  var11 = var10.q();
               }

               double var13 = 0.0D;
               double var15 = 0.0D;
               double var17;
               switch(var4.g()) {
               case 0:
                  var17 = var4.e().size() > var9 ? var4.a(var4.e().get(var9)) : 0.0D;
                  var13 = var17;
                  var17 = var4.f().size() > var9 ? var4.a(var4.f().get(var9)) : 0.0D;
                  var15 = var17;
                  break;
               case 1:
                  var13 = var4.c();
                  var15 = var13;
                  break;
               case 2:
                  var13 = var4.c() * var11 / 100.0D;
                  var15 = -var13;
               }

               if (!var3 || var8 != 15 && var8 != 7) {
                  if (var3 && (var8 == 16 || var8 == 8)) {
                     var17 = var11;
                     double var25 = 0.0D;

                     zje var22;
                     double var23;
                     int var26;
                     for(var26 = 0; var26 < var6; ++var26) {
                        var22 = ((zbcq)var5.get(var26)).E().b(var9);
                        if (var22 != null) {
                           var23 = var22.v();
                           if (var23 > 0.0D && var11 > 0.0D) {
                              var17 += var23;
                           }

                           if (var23 <= 0.0D && var11 <= 0.0D) {
                              var17 += var23;
                           }
                        }
                     }

                     for(var26 = 0; var26 < var5.size(); ++var26) {
                        var22 = ((zbcq)var5.get(var26)).E().b(var9);
                        if (var22 != null) {
                           var23 = var22.v();
                           var25 += Math.abs(var23);
                        }
                     }

                     var11 = var17 * 100.0D / var25;
                     var15 = var15 * 100.0D / var25;
                     var13 = var13 * 100.0D / var25;
                  }
               } else {
                  var17 = var11;

                  for(int var19 = 0; var19 < var6; ++var19) {
                     zje var20 = ((zbcq)var5.get(var19)).E().b(var9);
                     if (var20 != null) {
                        double var21 = var20.v();
                        if (var21 > 0.0D && var11 > 0.0D) {
                           var17 += var21;
                        }

                        if (var21 <= 0.0D && var11 <= 0.0D) {
                           var17 += var21;
                        }
                     }
                  }

                  var11 = var17;
               }

               if (var15 > 0.0D && var15 + var11 >= var0.z() && (var4.d() == 0 || var4.d() == 3)) {
                  for(var17 = var0.z() + var0.x(); var17 <= var15 + var11 + var0.x(); var17 += var0.x()) {
                     var2.add(0, var17);
                  }

                  var0.d((Double)var2.get(0));
               }

               if (var13 < 0.0D && -var13 + var11 >= var0.z() && (var4.d() == 0 || var4.d() == 1)) {
                  for(var17 = var0.z() + var0.x(); var17 <= -var13 + var11 + var0.x(); var17 += var0.x()) {
                     var2.add(0, var17);
                  }

                  var0.d((Double)var2.get(0));
               }

               if (var13 > 0.0D && var11 - var13 <= var0.D() && (var4.d() == 0 || var4.d() == 1)) {
                  for(var17 = var0.D() - var0.x(); var17 >= var11 - var13 - var0.x(); var17 -= var0.x()) {
                     com.aspose.cells.b.a.a.ze.a(var2, (Object)var17);
                  }

                  var0.f((Double)var2.get(var2.size() - 1));
               }

               if (var15 < 0.0D && var11 + var15 <= var0.D() && (var4.d() == 0 || var4.d() == 3)) {
                  for(var17 = var0.D() - var0.x(); var17 >= var11 + var15 - var0.x(); var17 -= var0.x()) {
                     com.aspose.cells.b.a.a.ze.a(var2, (Object)var17);
                  }

                  var0.f((Double)var2.get(var2.size() - 1));
               }
            }
         }
      }

   }

   private static void a(zig var0, boolean var1, boolean var2) {
      c(var0.e(), var1);
      c(var0.g(), var2);
      c(var0.G(), var1);
      c(var0.I(), var2);
   }

   private static void c(zbp var0, boolean var1) {
      zbp var2 = zbr.a(var0);
      if (var2 != null) {
         if (var2.u() == 1 && !var2.p()) {
            if (!var1) {
               if (var0.c()) {
                  var0.a(3);
               } else {
                  var0.a(2);
               }
            } else if (var0.c()) {
               var0.a(2);
            } else {
               var0.a(3);
            }
         } else if (var2.u() != 1 && var2.p()) {
            if (!var1) {
               if (var0.c()) {
                  var0.a(3);
               } else {
                  var0.a(2);
               }
            } else if (var0.c()) {
               var0.a(2);
            } else {
               var0.a(3);
            }
         } else if (!var1) {
            if (var0.c()) {
               var0.a(0);
            } else {
               var0.a(1);
            }
         } else if (var0.c()) {
            var0.a(1);
         } else {
            var0.a(0);
         }

         if (var0.I() == 0) {
            switch(var0.a()) {
            case 0:
               var0.a(3);
               break;
            case 1:
               var0.a(2);
               break;
            case 2:
               var0.a(1);
               break;
            case 3:
               var0.a(0);
            }
         }

      }
   }

   static void f(zig var0) {
      ArrayList var1 = var0.z().j();
      zakz var2 = var0.k().j();

      for(int var3 = 0; var3 < var1.size(); ++var3) {
         zbcq var4 = (zbcq)var1.get(var3);
         zalb var5 = new zalb(var0, var0.l(), var3);
         var5.a(var4.i());
         if (var4.D()) {
            var5.a(var4.t());
         }

         var5.a(1);
         var5.a(var4);
         var2.a(var5);
      }

   }

   static void g(zig var0) {
      ArrayList var1 = var0.z().j();
      zakx var2 = var0.x();
      zakz var3 = var2.f();
      zakz var4 = var2.e();
      boolean var5 = true;
      boolean var6 = false;

      int var9;
      for(int var7 = 0; var7 < var1.size(); ++var7) {
         zbcq var8 = (zbcq)var1.get(var7);
         if (var7 == 0 && var8.j()) {
            var5 = false;
         }

         var9 = var8.ax();
         zalb var10 = var3.c(var9);
         zalb var11;
         if (var10 == null) {
            var11 = new zalb(var0, var2, var9);
            var11.a(var8.i());
            if (var8.D()) {
               var11.a(var8.t());
            }

            var11.a(1);
            var11.a(var8);
            zxp.a(var2.c().k(), var11.a());
            if (!var6) {
               var4.a(var11);
            }

            if (var8.b(new int[]{44})) {
               var6 = true;
            }
         } else if (!var10.b()) {
            var11 = new zalb(var0, var2, var9);
            var11.a(var8.i());
            if (var8.D()) {
               var11.a(var8.t());
            }

            var11.a(1);
            var11.a(var8);
            var11.a(var10.c());
            var11.a(var10.e());
            zxp.a(var10.a(), var11.a());
            if (!var6) {
               var4.a(var11);
            }

            if (var8.b(new int[]{44})) {
               var6 = true;
            }
         }
      }

      ArrayList var14 = new ArrayList();
      if (var5) {
         com.aspose.cells.b.a.a.ze.a(var14, (Collection)var0.z().l());
         com.aspose.cells.b.a.a.ze.a(var14, (Collection)var0.z().m());
      } else {
         com.aspose.cells.b.a.a.ze.a(var14, (Collection)var0.z().m());
         com.aspose.cells.b.a.a.ze.a(var14, (Collection)var0.z().l());
      }

      int var15 = var4.getCount() > 0 ? var4.getCount() - 1 : 0;

      for(var9 = 0; var9 < var14.size(); ++var9) {
         zbtu var16 = (zbtu)var14.get(var9);
         int var17 = var1.size() + var16.u();
         zalb var12 = var3.c(var17);
         zalb var13;
         if (var12 == null) {
            var13 = new zalb(var0, var2, var17);
            var13.a(var16.l());
            if (var16.n()) {
               var13.a(var16.m());
            }

            var13.a(2);
            var13.a(var16.c().a());
            var13.a(var16);
            zxp.a(var2.c().k(), var13.a());
            a(var13, var4, var15);
         } else if (!var12.b()) {
            var13 = new zalb(var0, var2, var17);
            var13.a(var16.l());
            if (var16.n()) {
               var13.a(var16.m());
            }

            var13.a(2);
            var13.a(var16.c().a());
            var13.a(var16);
            var13.a(var12.c());
            var13.a(var12.e());
            zxp.a(var12.a(), var13.a());
            a(var13, var4, var15);
         }
      }

   }

   private static void a(zalb var0, zakz var1, int var2) {
      if (var1.getCount() == 0) {
         var1.a(var0);
      } else {
         boolean var3 = false;

         for(int var4 = var2; var4 < var1.getCount(); ++var4) {
            if (var1.b(var4).f() > var0.f()) {
               var1.a(var4, var0);
               var3 = true;
               break;
            }
         }

         if (!var3) {
            var1.a(var0);
         }
      }

   }

   static void a(zig var0, zbcq var1) {
      zakx var2 = var0.x();
      zakz var3 = var2.f();
      zakz var4 = var2.e();
      ArrayList var5;
      if (var1.ag() == 1) {
         var5 = var0.z().c();
      } else {
         var5 = var0.z().d();
      }

      for(int var6 = 0; var6 < var1.E().getCount(); ++var6) {
         zje var7 = var1.E().b(var6);
         zalb var9 = var3.c(var6);
         int var10 = var6 + 1;
         String var11 = com.aspose.cells.b.a.zo.a(var10);
         if (var5.size() > var6) {
            zfp var12 = (zfp)var5.get(var6);
            var11 = zald.a(var0, var12, var0.X());
         }

         zalb var13;
         if (var9 == null) {
            var13 = new zalb(var0, var2, var6);
            var13.a(var11);
            if (var1.D()) {
               var13.a(var1.t());
            }

            var13.a(1);
            var13.a(var1);
            zxp.a(var2.c().k(), var13.a());
            var4.a(var13);
         } else if (!var9.b()) {
            var13 = new zalb(var0, var2, var6);
            var13.a(var11);
            if (var1.D()) {
               var13.a(var1.t());
            }

            var13.a(1);
            var13.a(var1);
            var13.a(var9.c());
            var13.a(var9.e());
            zxp.a(var9.a(), var13.a());
            var4.a(var13);
         }
      }

   }

   static int a(List var0) {
      ArrayList var1 = new ArrayList();

      for(int var2 = 0; var2 < var0.size(); ++var2) {
         com.aspose.cells.b.a.a.ze.a(var1, (Object)((zbcq)((zbcq)var0.get(var2))).E().getCount());
      }

      Collections.sort(var1);
      return var1.size() == 0 ? 0 : (Integer)var1.get(var1.size() - 1);
   }

   static boolean a(List var0, double[] var1, double[] var2, zbp var3) {
      List var4 = b(var0);
      var1[0] = 0.0D;
      var2[0] = 0.0D;
      int var5 = 0;

      for(int var6 = 0; var6 < var4.size(); ++var6) {
         double var7 = 0.0D;
         double var9 = 0.0D;
         double[] var11 = new double[]{var7};
         double[] var12 = new double[]{var9};
         boolean var13 = a((ArrayList)var4.get(var6), var11, var12, var3);
         var7 = var11[0];
         var9 = var12[0];
         if (var6 == var5 && !var13) {
            ++var5;
         } else if (var6 == var5) {
            var1[0] = var7;
            var2[0] = var9;
         } else {
            if (var7 < var1[0]) {
               var1[0] = var7;
            }

            if (var9 > var2[0]) {
               var2[0] = var9;
            }
         }
      }

      if (var5 == var4.size() && var3.M() != var3.N()) {
         var1[0] = 0.0D;
         var2[0] = 1.0D;
         if (!var3.M()) {
            var3.f(0.0D);
         }

         if (!var3.N()) {
            var3.d(1.0D);
         }
      } else {
         if (!var3.M()) {
            var1[0] = var3.n() ? var3.g(var3.D()) : var3.D();
         }

         if (!var3.N()) {
            var2[0] = var3.n() ? var3.g(var3.z()) : var3.z();
         }
      }

      return c(var0);
   }

   private static List b(List var0) {
      zbcq var1 = (zbcq)var0.get(0);
      ArrayList var2 = new ArrayList();
      ArrayList var3 = new ArrayList();
      ArrayList var4 = new ArrayList();
      Iterator var5 = var0.iterator();

      while(var5.hasNext()) {
         zbcq var6 = (zbcq)var5.next();
         if (var6.a(new int[]{var1.m()})) {
            com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
         } else {
            com.aspose.cells.b.a.a.ze.a(var3, (Object)var6);
         }
      }

      if (var4.size() > 0) {
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
      }

      ArrayList var9 = new ArrayList();
      if (var3.size() > 0) {
         var1 = (zbcq)var3.get(0);
         ArrayList var10 = new ArrayList();
         com.aspose.cells.b.a.a.ze.a(var10, (Collection)var3);
         var3.clear();
         Iterator var7 = var10.iterator();

         while(var7.hasNext()) {
            zbcq var8 = (zbcq)var7.next();
            if (var8.a(new int[]{var1.m()})) {
               com.aspose.cells.b.a.a.ze.a(var9, (Object)var8);
            } else {
               com.aspose.cells.b.a.a.ze.a(var3, (Object)var8);
            }
         }
      }

      if (var9.size() > 0) {
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var9);
      }

      if (var3.size() > 0) {
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var3);
      }

      return var2;
   }

   private static boolean a(ArrayList var0, double[] var1, double[] var2, zbp var3) {
      boolean var4 = false;
      zbcu var5 = new zbcu();
      Collections.sort(var0, var5);
      var1[0] = 0.0D;
      var2[0] = 0.0D;
      zbcq var6 = (zbcq)var0.get(0);
      int var7;
      double var10;
      double var15;
      boolean var18;
      double var46;
      if (var6.an()) {
         int var9;
         if (var6.ao()) {
            var7 = a((List)var0);
            boolean var8 = true;

            for(var9 = 0; var9 < var7; ++var9) {
               var10 = 0.0D;

               for(int var12 = 0; var12 < var0.size(); ++var12) {
                  zbcq var13 = (zbcq)var0.get(var12);
                  if (!var13.an()) {
                     break;
                  }

                  zje var14 = var13.E().b(var9);
                  if (var14 != null && !var14.a() && var14 != null) {
                     var15 = var14.v();
                     var10 += var15;
                     if (var8) {
                        var8 = false;
                        var4 = true;
                        var1[0] = var10;
                        var2[0] = var10;
                     } else {
                        if (var10 < var1[0]) {
                           var1[0] = var10;
                        }

                        if (var10 > var2[0]) {
                           var2[0] = var10;
                        }
                     }
                  }
               }
            }
         } else {
            var7 = a(var0);
            new ArrayList();
            var9 = a((List)var0);
            boolean var38 = true;

            for(int var11 = 0; var11 < var9; ++var11) {
               double var42 = 0.0D;
               var46 = 0.0D;
               boolean var16 = false;
               boolean var17 = false;
               var18 = true;

               for(int var19 = 0; var19 < var0.size(); ++var19) {
                  zbcq var20 = (zbcq)var0.get(var19);
                  if (!var20.an()) {
                     break;
                  }

                  zje var21 = var20.E().b(var11);
                  if (var21 != null && !var21.a() && var21 != null) {
                     double var22 = var21.v();
                     if (var38) {
                        var38 = false;
                        var18 = false;
                        var4 = true;
                        if (var7 == 1) {
                           var1[0] = var22;
                        } else if (var7 == 2) {
                           var2[0] = var22;
                        }
                     } else if (var18) {
                        var18 = false;
                        if (var7 == 1 && var22 < var1[0]) {
                           var1[0] = var22;
                        } else if (var7 == 2 && var22 > var2[0]) {
                           var2[0] = var22;
                        }
                     }

                     if (var22 < 0.0D) {
                        var17 = true;
                        var46 += var22;
                     }

                     if (var22 > 0.0D) {
                        var16 = true;
                        var42 += var22;
                     }
                  }
               }

               if (var17 && var46 < var1[0]) {
                  var1[0] = var46;
               }

               if (var16 && var42 > var2[0]) {
                  var2[0] = var42;
               }
            }
         }
      } else {
         int var35;
         double var40;
         if (var6.ap()) {
            var4 = true;
            double var37;
            double var44;
            if (var6.aq()) {
               var7 = a((List)var0);

               for(var35 = 0; var35 < var7; ++var35) {
                  var37 = 0.0D;
                  var40 = 0.0D;
                  var44 = 0.0D;
                  var15 = 0.0D;

                  int var49;
                  for(var49 = 0; var49 < var0.size(); ++var49) {
                     zbcq var51 = (zbcq)var0.get(var49);
                     if (!var51.ap()) {
                        break;
                     }

                     zje var53 = var51.E().b(var35);
                     if (var53 != null) {
                        double var56 = var53.v();
                        var37 += var56;
                        var40 += Math.abs(var56);
                        if (var37 < var44) {
                           var44 = var37;
                        }

                        if (var37 > var15) {
                           var15 = var37;
                        }
                     }
                  }

                  if (var40 != 0.0D) {
                     var49 = (int)(100.0D * var44 / var40);
                     if ((double)var49 < var1[0]) {
                        var1[0] = (double)var49;
                     }

                     var49 = (int)(100.0D * var15 / var40);
                     if ((double)var49 > var2[0]) {
                        var2[0] = (double)var49;
                     }
                  }
               }
            } else if (var6.ar()) {
               var7 = a((List)var0);
               double var36 = 0.0D;
               var10 = 0.0D;
               boolean var43 = true;
               boolean var45 = true;
               var46 = 0.0D;
               double var48 = 0.0D;
               var18 = true;
               boolean var54 = true;

               for(int var57 = 0; var57 < var7; ++var57) {
                  double var58 = 0.0D;
                  double var23 = 0.0D;
                  double var25 = 0.0D;
                  double var27 = 0.0D;

                  int var29;
                  for(var29 = 0; var29 < var0.size(); ++var29) {
                     zbcq var30 = (zbcq)var0.get(var29);
                     if (!var30.ap()) {
                        break;
                     }

                     zje var31 = var30.E().b(var57);
                     if (var31 != null) {
                        double var32 = var31.v();
                        if (var29 == 0) {
                           var27 = var32;
                        }

                        var58 += Math.abs(var32);
                        if (var32 < 0.0D) {
                           var25 += var32;
                        }

                        if (var32 > 0.0D) {
                           var23 += var32;
                        }
                     }

                     if (var29 == var0.size() - 1) {
                        int var59 = (int)(100.0D * var27 / var58);
                        if (var59 < 0) {
                           if (var54) {
                              var48 = (double)var59;
                              var54 = false;
                           } else if ((double)var59 > var48) {
                              var48 = (double)var59;
                           }
                        }

                        if (var59 > 0) {
                           if (var18) {
                              var46 = (double)var59;
                              var18 = false;
                           } else if ((double)var59 < var46) {
                              var46 = (double)var59;
                           }
                        }
                     }
                  }

                  if (var58 != 0.0D) {
                     var29 = (int)(100.0D * var25 / var58);
                     if (var43 && var29 != 0) {
                        var10 = (double)var29;
                        var43 = false;
                     } else if ((double)var29 < var10) {
                        var10 = (double)var29;
                     }

                     var29 = (int)(100.0D * var23 / var58);
                     if (var45 && var29 != 0) {
                        var36 = (double)var29;
                        var45 = false;
                     } else if ((double)var29 > var36) {
                        var36 = (double)var29;
                     }
                  }
               }

               if (!var45 && var43) {
                  var2[0] = var36;
                  var1[0] = var46;
                  if (var3.N() && var3.M()) {
                     var3.d(var2[0]);
                  }
               } else if (var45 && !var43) {
                  var2[0] = var48;
                  var1[0] = var10;
                  if (var3.N() && var3.M()) {
                     var3.f(var1[0]);
                  }
               } else {
                  var2[0] = var36;
                  var1[0] = var10;
               }
            } else {
               var7 = a((List)var0);

               for(var35 = 0; var35 < var7; ++var35) {
                  var37 = 0.0D;
                  var40 = 0.0D;
                  var44 = 0.0D;

                  for(int var47 = 0; var47 < var0.size(); ++var47) {
                     zbcq var50 = (zbcq)var0.get(var47);
                     if (!var50.ap()) {
                        break;
                     }

                     zje var52 = var50.E().b(var35);
                     if (var52 != null) {
                        double var55 = var52.v();
                        var37 += Math.abs(var55);
                        if (var55 < 0.0D) {
                           var44 += var55;
                        }

                        if (var55 > 0.0D) {
                           var40 += var55;
                        }
                     }
                  }

                  if (var37 != 0.0D) {
                     if ((double)((int)(100.0D * var44 / var37)) < var1[0]) {
                        var1[0] = (double)((int)(100.0D * var44 / var37));
                     }

                     if ((double)((int)(100.0D * var40 / var37)) > var2[0]) {
                        var2[0] = (double)((int)(100.0D * var40 / var37));
                     }
                  }
               }
            }
         } else {
            boolean var34 = true;

            for(var35 = 0; var35 < var0.size(); ++var35) {
               zjg var39 = ((zbcq)((zbcq)var0.get(var35))).E();

               for(int var41 = 0; var41 < var39.getCount(); ++var41) {
                  if (var39.a(var41) == null || !var39.a(var41).a()) {
                     if (var39.a(var41) != null && var39.a(var41).e()) {
                        var4 = true;
                     } else {
                        var40 = var39.a(var41) == null ? 0.0D : var39.a(var41).v();
                        if (var34) {
                           var1[0] = var40;
                           var2[0] = var40;
                           var4 = true;
                           var34 = false;
                        } else {
                           if (var40 < var1[0]) {
                              var1[0] = var40;
                           }

                           if (var40 > var2[0]) {
                              var2[0] = var40;
                           }
                        }
                     }
                  }
               }
            }
         }
      }

      return var4;
   }

   static int a(ArrayList var0) {
      boolean var1 = false;
      boolean var2 = false;

      for(int var3 = 0; var3 < var0.size(); ++var3) {
         zjg var4 = ((zbcq)((zbcq)var0.get(var3))).E();

         for(int var5 = 0; var5 < var4.getCount(); ++var5) {
            if (var4.a(var5) != null) {
               double var6 = var4.a(var5).v();
               if (var6 > 0.0D) {
                  var1 = true;
               } else if (var6 < 0.0D) {
                  var2 = true;
               }
            }
         }
      }

      if (var1 && !var2) {
         return 1;
      } else if (!var1 && var2) {
         return 2;
      } else {
         return 3;
      }
   }

   private static boolean c(List var0, double[] var1, double[] var2, zbp var3) {
      var1[0] = Double.MAX_VALUE;
      var2[0] = -1.7976931348623157E308D;

      for(int var4 = 0; var4 < var0.size(); ++var4) {
         zbcq var5 = (zbcq)var0.get(var4);
         zjg var6 = var5.E();
         double var7 = Double.MAX_VALUE;
         double var9 = -1.7976931348623157E308D;
         boolean var11 = true;

         for(int var12 = 0; var12 < var6.getCount(); ++var12) {
            if (var6.a(var12) != null && !var6.a(var12).b()) {
               double var13 = var6.a(var12).q();
               if (var11) {
                  var7 = var13;
                  var9 = var13;
                  var11 = false;
               }

               if (var13 < var7) {
                  var7 = var13;
               }

               if (var13 > var9) {
                  var9 = var13;
               }
            }
         }

         if (var11) {
            var7 = 0.0D;
            var9 = 0.0D;
         }

         double var18 = 0.0D;
         double var14 = 0.0D;

         for(int var16 = 0; var16 < var5.G().getCount(); ++var16) {
            zbtu var17 = var5.G().c(var16);
            if (var17.d().g()) {
               if (var17.h() > var18) {
                  var18 = var17.h();
               }

               if (var17.e() > var14) {
                  var14 = var17.e();
               }
            }
         }

         var7 -= var14;
         var9 += var18;
         if (var7 < var1[0]) {
            var1[0] = var7;
         }

         if (var9 > var2[0]) {
            var2[0] = var9;
         }
      }

      if (!var3.M()) {
         var1[0] = var3.n() ? var3.g(var3.D()) : var3.D();
      }

      if (!var3.N()) {
         var2[0] = var3.n() ? var3.g(var3.z()) : var3.z();
      }

      return d(var0);
   }

   private static boolean a(zig var0, List var1, List var2) {
      if (var2.size() > 0 && var1.size() > 0) {
         zbp var3 = var0.G();
         zbp var4 = var0.I();
         zbcq var5 = (zbcq)var1.get(0);
         zbcq var6 = (zbcq)var2.get(0);
         if (var5.ah() != 14 && var5.ah() != 15 && var5.ah() != 16 && var5.ah() != 60) {
            if (var5.ah() != 6 && var5.ah() != 7 && var5.ah() != 8) {
               if (var5.ah() != 57) {
                  return false;
               }

               if (var6.ah() != 57) {
                  return false;
               }
            } else if (var6.ah() != 6 && var6.ah() != 7 && var6.ah() != 8) {
               return false;
            }
         } else if (var6.ah() != 14 && var6.ah() != 15 && var6.ah() != 16 && var6.ah() != 60) {
            return false;
         }

         return !var3.q() || !var4.q();
      } else {
         return false;
      }
   }

   private static zbp j(zig var0) {
      zbp var1 = var0.G();
      zbp var2 = var0.I();
      return !var1.q() && var2.q() ? var2 : var1;
   }

   private static zbp k(zig var0) {
      zbp var1 = var0.G();
      zbp var2 = var0.I();
      return !var1.q() && var2.q() ? var1 : var2;
   }

   static boolean a(List var0, List var1, double[] var2, double[] var3, zbp var4) {
      double var5 = 0.0D;
      double var7 = 0.0D;
      double[] var9 = new double[]{var5};
      double[] var10 = new double[]{var7};
      b(var0, var9, var10, var4);
      var5 = var9[0];
      var7 = var10[0];
      double var11 = 0.0D;
      double var13 = 0.0D;
      double[] var15 = new double[]{var11};
      double[] var16 = new double[]{var13};
      b(var1, var15, var16, var4);
      var11 = var15[0];
      var13 = var16[0];
      if (var5 < var11) {
         var2[0] = var5;
      } else {
         var2[0] = var11;
      }

      if (var7 < var13) {
         var3[0] = var13;
      } else {
         var3[0] = var7;
      }

      if (!var4.M()) {
         var2[0] = var4.n() ? var4.g(var4.D()) : var4.D();
      }

      if (!var4.N()) {
         var3[0] = var4.n() ? var4.g(var4.z()) : var4.z();
      }

      return c(var0) && c(var1);
   }

   static void b(List var0, double[] var1, double[] var2, zbp var3) {
      List var4 = b(var0);
      var1[0] = 0.0D;
      var2[0] = 0.0D;

      for(int var5 = 0; var5 < var4.size(); ++var5) {
         double var6 = 0.0D;
         double var8 = 0.0D;
         double[] var10 = new double[]{var6};
         double[] var11 = new double[]{var8};
         a((ArrayList)var4.get(var5), var10, var11, var3);
         var6 = var10[0];
         var8 = var11[0];
         if (var5 == 0) {
            var1[0] = var6;
            var2[0] = var8;
         } else {
            if (var6 < var1[0]) {
               var1[0] = var6;
            }

            if (var8 > var2[0]) {
               var2[0] = var8;
            }
         }
      }

   }

   private static void a(zbp var0, zbp var1) {
      var0.l = var1.l;
      var0.d(var1.z());
      var0.f(var1.D());
      var0.g(var1.y());
      var0.c(var1.x());
      var0.i(var1.C());
      var0.e(var1.B());
   }

   private static void d(zbp var0) {
      var0.a = var0.l;
      var0.b = var0.z();
      var0.c = var0.D();
      var0.d = var0.x();
      var0.e = var0.B();
   }

   private static boolean c(List var0) {
      boolean var1 = true;
      Iterator var2 = var0.iterator();

      while(var2.hasNext()) {
         zbcq var3 = (zbcq)var2.next();
         if (!var3.af()) {
            var1 = false;
         }
      }

      return var1;
   }

   private static boolean d(List var0) {
      boolean var1 = true;
      Iterator var2 = var0.iterator();

      while(var2.hasNext()) {
         zbcq var3 = (zbcq)var2.next();
         if (!var3.ae()) {
            var1 = false;
         }
      }

      return var1;
   }

   static void a(zn var0, zbp var1, double var2, double var4, boolean var6, ArrayList var7, int var8, com.aspose.cells.b.a.b.zp var9, boolean var10, zbcq var11) {
      if (var1.n()) {
         a(var0, var1, var2, var4, var7, var8, var9, var10, var11);
      } else {
         double var12 = var2;
         double var14 = var4;
         zig var16 = var1.e();
         boolean var17 = b(var8);
         double var18;
         double var20;
         if (var2 == var4 && var2 == 0.0D) {
            var18 = 1.2D;
            if (!var6 || e(var11.m())) {
               var18 = 1.0D;
            }

            if (var17) {
               var18 = 100.0D;
            }

            var1.d(var18);
            var2 = var18;
            var12 = var18;
            var1.f(0.0D);
         } else if (var2 <= var4) {
            double[] var22;
            double[] var23;
            if (!var1.N() && var1.M()) {
               var18 = 0.0D;
               if (var1.O()) {
                  var20 = 0.0D;
                  var22 = new double[]{var18};
                  var23 = new double[]{var20};
                  a(var2, var22, var23);
                  var18 = var22[0];
                  var20 = var23[0];
               } else {
                  var18 = var1.x();
               }

               if (var1.z() > 0.0D) {
                  var4 = 0.0D;
               } else if (var18 == 0.0D) {
                  var4 = -1.0D;
               } else {
                  var4 = var2 - Math.abs(var18) * 10.0D;
               }
            } else if (var1.N() && !var1.M()) {
               var18 = 0.0D;
               if (var1.O()) {
                  var20 = 0.0D;
                  var22 = new double[]{var18};
                  var23 = new double[]{var20};
                  a(var4, var22, var23);
                  var18 = var22[0];
                  var20 = var23[0];
               } else {
                  var18 = var1.x();
               }

               if (var1.D() < 0.0D) {
                  var2 = 0.0D;
               } else if (var18 == 0.0D) {
                  var2 = 1.0D;
               } else {
                  var2 = var4 + Math.abs(var18) * 10.0D;
               }
            }
         }

         boolean var38 = var1.N();
         boolean var19 = var1.M();
         var20 = 0.0D;
         byte var39 = 1;
         if (var17) {
            if (var2 == 100.0D && var1.N()) {
               var1.d(100.0D);
            }

            if (var4 == -100.0D && var1.M()) {
               var1.f(-100.0D);
            }
         }

         double var41 = 0.0D;
         double var25 = 0.0D;
         double[] var27 = new double[]{var41};
         double[] var28 = new double[]{var25};
         double[] var29 = new double[]{var4};
         double[] var30 = new double[]{var2};
         double[] var31 = new double[]{var20};
         int[] var32 = new int[]{var39};
         a(var27, var28, var29, var30, var31, var32, var1, var10, var12, var14, var38, var19);
         var41 = var27[0];
         var25 = var28[0];
         var4 = var29[0];
         var2 = var30[0];
         var20 = var31[0];
         int var40 = var32[0];
         if (!var1.P()) {
            if (!var1.O() && var1.x() < var1.B()) {
               throw new IllegalArgumentException("The numbers you specified can't be used because the interval for the minor unittick marks must be less than or equal to the interval for the major unit tick marks!");
            }

            if (var20 < var1.B()) {
               var20 = var1.B();
            }
         }

         a(var1, var40, var20, var25, var41, var7, var12, var14, var38, var19, var17);
         int var42 = a(var0, var1, var10, var11, var9);
         boolean var43 = false;
         int var44;
         if (var1.e().aa()) {
            if (var10) {
               var44 = (int)var1.e().S().g();
            } else {
               var44 = (int)var1.e().S().i();
            }
         } else if (var10) {
            var44 = var9.e();
         } else {
            var44 = var9.f();
         }

         int var45 = var7.size();
         double var46 = var20;
         int var47 = var7.size();

         for(int var33 = var42; var1.O() && var7.size() > 3 && ((!d(var8) || !var1.c()) && var42 - var45 > var44 && var44 != 0 || d(var8) && var1.c() && var7.size() > 10 && (float)var42 * 4.0F > (float)var44 && var44 != 0); var33 = var42) {
            double var34 = 0.0D;
            double[] var36 = new double[]{var20};
            double[] var37 = new double[]{var34};
            a(var20, var36, var37);
            var20 = var36[0];
            var34 = var37[0];
            var20 *= 10.0D;
            a(var1, var40, var20, var25, var41, var7, var12, var14, var38, var19, var17);
            var42 = a(var0, var1, var10, var11, var9);
            var45 = var7.size();
            if (var46 == var20 || var47 == var7.size() || var33 == var42) {
               if (var20 != var46) {
                  var20 = var46;
                  a(var1, var40, var46, var25, var41, var7, var12, var14, var38, var19, var17);
               }
               break;
            }

            var46 = var20;
            var47 = var7.size();
         }

         if (var7.size() >= 2) {
            var1.d((Double)var7.get(0));
            var1.f((Double)var7.get(var7.size() - 1));
            if (var1.O()) {
               var1.c(var20);
            }

            if (var1.P()) {
               var1.e(var1.x() / 5.0D);
            }
         }

      }
   }

   private static void a(double[] var0, double[] var1, double[] var2, double[] var3, double[] var4, int[] var5, zbp var6, boolean var7, double var8, double var10, boolean var12, boolean var13) {
      double var14 = 0.0D;
      double var16 = 0.0D;
      double var18 = 0.0D;
      double var20 = 0.0D;
      double var22 = zbuk.a(var3[0], zbuk.g(var3[0]));
      double var24 = zbuk.a(var2[0], zbuk.g(var2[0]));
      if (var6.O()) {
         boolean var26 = true;
         double[] var27 = new double[]{var18};
         double[] var28 = new double[]{var14};
         a(var2[0], var27, var28);
         var18 = var27[0];
         var14 = var28[0];
         double[] var29 = new double[]{var20};
         double[] var30 = new double[]{var16};
         a(var3[0], var29, var30);
         var20 = var29[0];
         var16 = var30[0];
         var1[0] = var2[0] < var14 ? var2[0] : var14;
         var0[0] = var3[0] > var16 ? var3[0] : var16;
         if (Math.abs(var20) > Math.abs(var18)) {
            var4[0] = Math.abs(var20);
         } else {
            var4[0] = Math.abs(var18);
         }

         double var31;
         double var33;
         double var35;
         double[] var37;
         double[] var38;
         int var39;
         double var40;
         if (var22 != var24 && var3[0] > 0.0D && var2[0] > 0.0D) {
            var31 = zbuk.a(var3[0], var2[0]);
            var33 = 0.0D;
            var35 = 0.0D;
            var37 = new double[]{var33};
            var38 = new double[]{var35};
            a(var31, var37, var38);
            var33 = var37[0];
            var35 = var38[0];
            if (var2[0] / var31 >= 5.0D) {
               if (!var6.N()) {
                  var0[0] = var3[0];
                  var1[0] = var2[0] - var35;
               } else {
                  var1[0] = zbuk.a(var2[0], var35) / 2.0D;
                  var0[0] = var2[0] + var35;
               }

               var4[0] = Math.abs(var33);
               if (var6.g() != 0 && var6.g() != 2) {
                  if (zbuk.a(var3[0], var2[0]) / var4[0] >= 8.0D) {
                     a(var4);
                  }
               } else if (zbuk.a(var3[0], var2[0]) / var4[0] >= 9.0D) {
                  a(var4);
               }

               var39 = zbuk.a(var4);
               var40 = 0.0D;
               var40 = zbuk.a(Math.floor((3.0D * var2[0] - var3[0]) / (2.0D * var4[0])) * var4[0], var39);
               if (var6.M() && var6.N()) {
                  if (var6.g() == 0 || var6.g() == 2) {
                     while(zbuk.a(var10, var40) > var4[0] && var40 != 0.0D) {
                        var40 += var4[0];
                     }
                  }

                  var6.f(var40);
                  var1[0] = var40;
               }
            } else {
               if (var6.M()) {
                  var1[0] = 0.0D;
               }

               if (var6.M() && var6.N()) {
                  var6.f(0.0D);
               } else if (!var6.M() && var6.N()) {
                  var4[0] = Math.abs(var33);
               }
            }
         } else if (var22 != var24 && var3[0] < 0.0D && var2[0] < 0.0D) {
            var31 = var2[0] - var3[0];
            var33 = 0.0D;
            var35 = 0.0D;
            var37 = new double[]{var33};
            var38 = new double[]{var35};
            a(var31, var37, var38);
            var33 = var37[0];
            var35 = var38[0];
            if (var2[0] / var31 < 5.0D) {
               if (var6.N()) {
                  var0[0] = 0.0D;
               }

               if (var6.N() && var6.M()) {
                  var6.d(0.0D);
               } else if (!var6.N() && var6.M()) {
                  var4[0] = Math.abs(var33);
               }
            } else {
               var0[0] = var3[0] - var35 / 2.0D;
               var1[0] = var3[0] + var35;
               var4[0] = Math.abs(var33);
               if ((var3[0] - var2[0]) / var4[0] >= 8.0D) {
                  a(var4);
               }

               var39 = zbuk.a(var4);

               for(var40 = 0.0D; var40 - 3.0D * var4[0] > var3[0]; var40 -= var4[0]) {
                  var40 = zbuk.a(var40, var39);
               }

               if (var6.N() && var6.M()) {
                  if (var6.g() == 0 || var6.g() == 2) {
                     while(zbuk.a(var40, var8) > var4[0] && var40 != 0.0D) {
                        var40 -= var4[0];
                     }
                  }

                  var6.d(var40);
                  var0[0] = var40;
               }
            }
         } else if (var22 != var24 && var3[0] > 0.0D && var2[0] < 0.0D) {
            var31 = var3[0] - var2[0];
            var33 = 0.0D;
            var35 = 0.0D;
            var37 = new double[]{var33};
            var38 = new double[]{var35};
            a(var31, var37, var38);
            var33 = var37[0];
            var35 = var38[0];
            var4[0] = Math.abs(var33);
            if ((var3[0] - var2[0]) / var4[0] > 9.5D) {
               a(var4);
            }
         }

         if (var6.N() && var6.M()) {
            var5[0] = 3;
            if (var2[0] == 0.0D || var3[0] == var2[0] && var3[0] > 0.0D) {
               var6.f(0.0D);
               var5[0] = 2;
               var1[0] = 0.0D;
            }

            if (var3[0] == 0.0D || var3[0] == var2[0] && var3[0] < 0.0D) {
               var6.d(0.0D);
               var5[0] = 1;
               var0[0] = 0.0D;
            }
         } else if (!var6.N() && var6.M()) {
            var5[0] = 1;
            var0[0] = var6.z();
            var3[0] = var6.z();
         } else if (var6.N() && !var6.M()) {
            var5[0] = 2;
            var1[0] = var6.D();
            var2[0] = var6.D();
         } else {
            var5[0] = 2;
            var1[0] = var6.D();
            var0[0] = var6.z();
            var2[0] = var6.D();
            var3[0] = var6.z();
            var31 = zbuk.a(var3[0], var2[0]);
            var33 = 0.0D;
            var35 = 0.0D;
            var37 = new double[]{var33};
            var38 = new double[]{var35};
            a(var31, var37, var38);
            var33 = var37[0];
            var35 = var38[0];
            String var47 = com.aspose.cells.b.a.zn.b(var33);
            if (var47.indexOf("5") > 0 && zbuk.a(var35, var31) == var33) {
               var4[0] = var33 * 0.4D;
            } else {
               var4[0] = var33;
            }
         }

         if ((!var7 || d(var6.e().N())) && var26) {
            a(var6, var1[0], var0[0], var4, var5[0], var8, var10, var12, var13);
         }
      } else {
         var4[0] = var6.x();
         var1[0] = var2[0];
         var0[0] = var3[0];
         double[] var32;
         double var34;
         int var36;
         double var42;
         double var43;
         double var44;
         double[] var45;
         double var46;
         double var48;
         if (var22 != var24 && var3[0] > 0.0D && var2[0] > 0.0D) {
            var42 = var3[0] - var2[0];
            var43 = 0.0D;
            var44 = 0.0D;
            var32 = new double[]{var43};
            var45 = new double[]{var44};
            a(var42, var32, var45);
            var43 = var32[0];
            var44 = var45[0];
            if (var2[0] / var42 < 5.0D) {
               if (var6.M() && var6.N()) {
                  var6.f(0.0D);
                  var2[0] = var6.D();
               }

               var1[0] = 0.0D;
            } else {
               var1[0] = var2[0] - var44 / 2.0D;
               var0[0] = var2[0] + var44;
               var34 = Math.abs(var43);
               var36 = zbuk.g(var34);

               for(var46 = 0.0D; var46 < var1[0]; var46 += var34) {
                  var46 = zbuk.a(var46, var36);
               }

               if (var6.M() && var6.N()) {
                  var36 = zbuk.a(var4);

                  for(var48 = 0.0D; var48 <= var46; var48 += var4[0]) {
                     var48 = zbuk.a(var48, var36);
                  }

                  if (var6.g() != 0 && var6.g() != 2) {
                     var6.f(var48 - var4[0]);
                  } else {
                     var6.f(var48);
                  }

                  var2[0] = var6.D();
                  var1[0] = var6.D();
               }
            }
         } else if (var22 != var24 && var3[0] < 0.0D && var2[0] < 0.0D) {
            var42 = var2[0] - var3[0];
            var43 = 0.0D;
            var44 = 0.0D;
            var32 = new double[]{var43};
            var45 = new double[]{var44};
            a(var42, var32, var45);
            var43 = var32[0];
            var44 = var45[0];
            if (var2[0] / var42 < 5.0D) {
               if (var6.N() && var6.M()) {
                  var6.d(0.0D);
                  var3[0] = var6.z();
               }

               var0[0] = 0.0D;
            } else {
               var0[0] = var3[0] - var44 / 2.0D;
               var1[0] = var3[0] + var44;
               var34 = Math.abs(var43);
               var36 = zbuk.g(var34);

               for(var46 = 0.0D; var46 > var0[0]; var46 -= var34) {
                  var46 = zbuk.a(var46, var36);
               }

               if (var6.N() && var6.M()) {
                  var36 = zbuk.a(var4);

                  for(var48 = 0.0D; var48 >= var46; var48 -= var4[0]) {
                     var48 = zbuk.a(var48, var36);
                  }

                  if (var6.g() != 0 && var6.g() != 2) {
                     var6.d(var48 + var4[0]);
                  } else {
                     var6.d(var48);
                  }

                  var3[0] = var6.z();
                  var0[0] = var6.z();
               }
            }
         }

         if (var6.N() && var6.M()) {
            var5[0] = 3;
            if (var2[0] == 0.0D) {
               var6.f(0.0D);
               var5[0] = 2;
               var1[0] = 0.0D;
            }

            if (var3[0] == 0.0D) {
               var6.d(0.0D);
               var5[0] = 1;
               var0[0] = 0.0D;
            }
         } else if (!var6.N() && var6.M()) {
            var5[0] = 1;
            var0[0] = var6.z();
            var3[0] = var6.z();
         } else if (var6.N() && !var6.M()) {
            var5[0] = 2;
            var1[0] = var6.D();
            var2[0] = var6.D();
         } else {
            var5[0] = 2;
            var1[0] = var6.D();
            var0[0] = var6.z();
            var2[0] = var6.D();
            var3[0] = var6.z();
         }
      }

   }

   private static boolean l(zig var0) {
      return var0.aa() || var0.N() == 57 || var0.N() == 59 || var0.N() == 58;
   }

   private static void a(zbp var0, int var1, double var2, double var4, double var6, ArrayList var8, double var9, double var11, boolean var13, boolean var14, boolean var15) {
      zig var16 = var0.e();
      boolean var17 = l(var0.e());
      char var18 = com.aspose.cells.b.a.ze.a(com.aspose.cells.b.a.c.zc.a().c());
      var8.clear();
      double var19;
      int var21;
      double var22;
      double var24;
      if (var1 == 1) {
         var19 = var6;
         var21 = zbuk.g(var2);

         for(var22 = zbuk.a(var6, var21); var22 >= var4 || zbuk.a(var4, var22) < var2 || var4 == var2 && var22 > 0.0D || var4 == var22 || zbuk.a(var22, var6) == var2 && var8.size() < 3; var22 = zbuk.a(var19, var21)) {
            if (!var0.M() && var19 < var0.D()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.D());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var22);
            }

            var19 = var6 - var2 * (double)var8.size();
         }

         if (var14) {
            var24 = 2.147483647E9D;
            if (var8.size() > 0) {
               var24 = (Double)var8.get(var8.size() - 1);
            }

            if (zbuk.a(var11, var24) > var2 && var24 != 0.0D) {
               var24 += var2;
               if ((var11 - var6) / (var24 - var6) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var11 - var6) / (var24 - var6) > 0.9523809523809523D && var24 != 0.0D) {
               var19 = zbuk.a(var24 - var2, var21);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }
      } else if (var1 == 2) {
         var21 = zbuk.g(var2);

         for(var22 = zbuk.a(var4, var21); var22 <= var6 || var22 < var6 + var2 || var22 == var2 && var6 > 0.0D || var22 == var6 || var22 == var6 + var2 && var8.size() < 3; var22 = zbuk.a(var19, var21)) {
            if (!var0.N() && var22 > var0.z()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.z());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var22);
            }

            var19 = var4 + var2 * (double)var8.size();
         }

         if (var13) {
            var24 = -2.147483648E9D;
            if (var8.size() > 0) {
               var24 = (Double)var8.get(var8.size() - 1);
            }

            if (zbuk.a(var24, var9) > var2 && var24 != 0.0D) {
               var24 -= var2;
               if ((var9 - var4) / (var24 - var4) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var9 - var4) / (var24 - var4) > 0.9523809523809523D && var24 != 0.0D) {
               var19 = zbuk.a(var24 + var2, var21);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }

         Collections.reverse(var8);
      } else {
         var19 = 0.0D;

         for(var21 = zbuk.g(var2); var19 <= var6 || zbuk.a(var19, var6) < var2 || var19 == var2 && var6 > 0.0D || var19 == var6 || zbuk.a(var19, var6) == var2 && var8.size() < 3; var19 += var2) {
            var19 = zbuk.a(var19, var21);
            if (!var0.N() && var19 > var0.z()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.z());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }

         if (var13) {
            var22 = -2.147483648E9D;
            if (var8.size() > 0) {
               var22 = (Double)var8.get(var8.size() - 1);
            }

            if (var22 - var9 > var2) {
               var22 -= var2;
               if ((var9 - var11) / (var22 - var11) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var9 - var11) / (var22 - var11) > 0.9523809523809523D) {
               var19 = zbuk.a(var22 + var2, var21);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }

         Collections.reverse(var8);

         for(var19 = 0.0D - var2; var19 >= var4 || zbuk.a(var4, var19) < var2 || var4 == var2 && var19 > 0.0D || var4 == var19 || zbuk.a(var4, var19) == var2 && var8.size() < 3; var19 -= var2) {
            var19 = zbuk.a(var19, var21);
            if (!var0.M() && var19 < var0.D()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.D());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }

         if (var14) {
            var22 = 2.147483647E9D;
            if (var8.size() > 0) {
               var22 = (Double)var8.get(var8.size() - 1);
            }

            if (var11 - var22 > var2) {
               var22 += var2;
               if ((var11 - var9) / (var22 - var9) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var11 - var9) / (var22 - var9) > 0.9523809523809523D) {
               var19 = zbuk.a(var22 - var2, var21);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }
      }

      if (var8.size() >= 2) {
         if ((var15 || l(var16)) && var9 > 0.0D && (Double)var8.get(0) >= var9 + var2 && (Double)var8.get(0) != 0.0D && var13 && var8.size() >= 3) {
            var8.remove(0);
         }

         if ((var15 || l(var16)) && var11 < 0.0D && (Double)var8.get(var8.size() - 1) <= zbuk.a(var11, var2) && (Double)var8.get(var8.size() - 1) != 0.0D && var14 && var8.size() >= 3) {
            var8.remove(var8.size() - 1);
         }
      }

   }

   static int a(zn var0, zbp var1, boolean var2, zbcq var3, com.aspose.cells.b.a.b.zp var4) {
      if (var1.I() == 3) {
         return 0;
      } else {
         int var5 = var3.ah();
         zig var6 = var1.e();
         zbtk var7 = var1.J();
         zje var8 = var3.E().b(0);
         String var9 = var8.z();
         boolean var10 = var8.A();
         boolean var11 = false;
         if (var7.h() && var8 != null) {
            var11 = true;
         }

         String var12 = "";

         for(int var13 = 1; var13 < var1.l.size() - 1; ++var13) {
            double var14 = (Double)var1.l.get(var13);
            if (var5 == 8 || var5 == 16) {
               var14 /= 100.0D;
               var9 = "0%";
            }

            String var16 = "";
            var14 *= Math.pow(10.0D, var1.T().f());
            if (var11) {
               var16 = zpw.a(var6.al(), var14, var9, var10);
            } else {
               var16 = zbr.a((zbp)var1, (Object)var14);
            }

            if (var16.length() > var12.length()) {
               var12 = var16;
            }
         }

         com.aspose.cells.b.a.b.zs var17 = new com.aspose.cells.b.a.b.zs(var4.e(), var4.f());
         new com.aspose.cells.b.a.b.zs();
         com.aspose.cells.b.a.b.zs var18;
         if (var7.d() == 0) {
            if (var1.d() && !f(var5)) {
               var18 = zbsq.b(var1.e().ap(), var12, var7.d(), var7.a(), (com.aspose.cells.b.a.b.zs)var17, 1, 1);
            } else {
               var18 = zbsq.a(var1.e().ap(), var12, var7.d(), var7.a(), (com.aspose.cells.b.a.b.zs)var17, 1, 1);
            }
         } else if (var1.d() && !f(var5)) {
            var18 = zbsq.b(var1.e().ap(), var12, var7.d(), var7.a(), (com.aspose.cells.b.a.b.zs)var17, 1, 1);
         } else {
            var18 = zbsq.a(var1.e().ap(), var12, var7.d(), var7.a(), (com.aspose.cells.b.a.b.zs)var17, 1, 1);
         }

         float var15 = 0.0F;
         int var19 = var1.l.size() - 1;
         if (var2) {
            var15 = (float)(var18.b() * var19);
         } else {
            var15 = (float)(var18.c() * var19);
         }

         return (int)((double)var15 + 0.5D);
      }
   }

   private static void a(double var0, double[] var2, double[] var3) {
      boolean var4 = true;
      if (var0 < 0.0D) {
         var4 = false;
      }

      var0 = Math.abs(var0);
      var2[0] = 0.0D;
      var3[0] = 0.0D;
      if (var0 > 1.0D) {
         b(var0, var2, var3);
      } else {
         if (var0 == 0.0D) {
            return;
         }

         int var5 = zbuk.g(var0);
         double var6 = var0 * Math.pow(10.0D, (double)var5);
         b(var6, var2, var3);
         var2[0] /= Math.pow(10.0D, (double)var5);
         var3[0] /= Math.pow(10.0D, (double)var5);
      }

      if (!var4) {
         var2[0] = -var2[0];
         var3[0] = -var3[0];
      }

   }

   private static void b(double var0, double[] var2, double[] var3) {
      char var4 = com.aspose.cells.b.a.ze.a(com.aspose.cells.b.a.c.zc.a().c());
      var0 = Math.abs(var0);
      var2[0] = 1.0D;
      var3[0] = 1.0D;
      String var5 = com.aspose.cells.b.a.zn.b(var0);
      String var6 = "";
      if (var5.indexOf("E") > 0) {
         String[] var7 = com.aspose.cells.b.a.zv.d(var5, 'E');
         var5 = var7[0];
         var6 = "E" + var7[1];
      }

      int var11 = com.aspose.cells.b.a.zo.a(Character.toString(var5.charAt(0)));
      int var8 = 0;
      if (var5.length() > 1) {
         if (var5.charAt(1) != var4) {
            var8 = com.aspose.cells.b.a.zo.a(Character.toString(var5.charAt(1)));
         } else {
            var8 = com.aspose.cells.b.a.zo.a(Character.toString(var5.charAt(2)));
         }
      }

      int var9;
      if (var11 == 1) {
         var9 = var8 / 2;
         ++var9;
         var8 = var9 * 2;
         var2[0] = 2.0D;
      } else if (var11 < 5) {
         if (var8 % 5 > 0) {
            ++var11;
            var8 = 0;
         } else {
            var8 = 5;
         }

         var2[0] = 5.0D;
      } else {
         ++var11;
         var2[0] = 10.0D;
         var8 = 0;
      }

      var9 = var5.length();
      int var10 = var5.indexOf(var4, 0);
      if (var10 > 0) {
         var9 = var10;
      }

      if ("".equals(var6)) {
         var2[0] *= Math.pow(10.0D, (double)(var9 - 2));
         var3[0] = (double)(var11 * 10 + var8) * Math.pow(10.0D, (double)(var9 - 2));
      } else {
         var2[0] *= Math.pow(10.0D, (double)(var9 - 2));
         var3[0] = (double)(var11 * 10 + var8) * Math.pow(10.0D, (double)(var9 - 2));
         var2[0] = com.aspose.cells.b.a.ze.g(com.aspose.cells.b.a.zn.b(var2[0]) + var6);
         var3[0] = com.aspose.cells.b.a.ze.g(com.aspose.cells.b.a.zn.b(var3[0]) + var6);
      }

   }

   private static void a(double[] var0) {
      char var1 = com.aspose.cells.b.a.ze.a(com.aspose.cells.b.a.c.zc.a().c());
      boolean var2 = true;
      if (var0[0] < 0.0D) {
         var2 = false;
      }

      var0[0] = Math.abs(var0[0]);
      int var3 = 1;
      String var4;
      if (var0[0] > 1.0D) {
         var4 = com.aspose.cells.b.a.zn.b(var0[0]);
         var3 = com.aspose.cells.b.a.zo.a(Character.toString(var4.charAt(0)));
      } else if (var0[0] == 0.0D) {
         var0[0] = 0.0D;
         return;
      }

      if (var0[0] < 1.0D) {
         var4 = com.aspose.cells.b.a.zn.b(var0[0]);

         for(int var5 = 0; var5 < var4.length(); ++var5) {
            if (var4.charAt(var5) != '0' && var4.charAt(var5) != var1) {
               var3 = com.aspose.cells.b.a.zo.a(Character.toString(var4.charAt(var5)));
               break;
            }
         }
      }

      if (var3 != 1 && var3 != 5) {
         var0[0] = var0[0] * 5.0D / 2.0D;
      } else {
         var0[0] = 2.0D * var0[0];
      }

      if (!var2) {
         var0[0] = -var0[0];
      }

   }

   private static void b(double[] var0) {
      char var1 = com.aspose.cells.b.a.ze.a(com.aspose.cells.b.a.c.zc.a().c());
      boolean var2 = true;
      if (var0[0] < 0.0D) {
         var2 = false;
      }

      var0[0] = Math.abs(var0[0]);
      int var3 = 1;
      String var4;
      if (var0[0] > 1.0D) {
         var4 = com.aspose.cells.b.a.zn.b(var0[0]);
         var3 = com.aspose.cells.b.a.zo.a(Character.toString(var4.charAt(0)));
      } else if (var0[0] == 0.0D) {
         var0[0] = 0.0D;
         return;
      }

      if (var0[0] < 1.0D) {
         var4 = com.aspose.cells.b.a.zn.b(var0[0]);

         for(int var5 = 0; var5 < var4.length(); ++var5) {
            if (var4.charAt(var5) != '0' && var4.charAt(var5) != var1) {
               var3 = com.aspose.cells.b.a.zo.a(Character.toString(var4.charAt(var5)));
               break;
            }
         }
      }

      if (var3 != 1 && var3 != 2) {
         var0[0] = var0[0] * 2.0D / 5.0D;
      } else {
         var0[0] /= 2.0D;
      }

      if (!var2) {
         var0[0] = -var0[0];
      }

   }

   static boolean b(int var0) {
      switch(var0) {
      case 2:
      case 5:
      case 8:
      case 11:
      case 16:
      case 20:
      case 23:
      case 26:
      case 30:
      case 33:
      case 39:
      case 42:
      case 52:
      case 55:
         return true;
      case 3:
      case 4:
      case 6:
      case 7:
      case 9:
      case 10:
      case 12:
      case 13:
      case 14:
      case 15:
      case 17:
      case 18:
      case 19:
      case 21:
      case 22:
      case 24:
      case 25:
      case 27:
      case 28:
      case 29:
      case 31:
      case 32:
      case 34:
      case 35:
      case 36:
      case 37:
      case 38:
      case 40:
      case 41:
      case 43:
      case 44:
      case 45:
      case 46:
      case 47:
      case 48:
      case 49:
      case 50:
      case 51:
      case 53:
      case 54:
      default:
         return false;
      }
   }

   static boolean c(int var0) {
      switch(var0) {
      case 12:
      case 13:
      case 60:
      case 61:
      case 62:
      case 63:
      case 64:
         return true;
      default:
         return false;
      }
   }

   private static boolean d(int var0) {
      return var0 == 13 || var0 == 12;
   }

   private static boolean e(int var0) {
      switch(var0) {
      case 1:
      case 4:
         return true;
      default:
         return false;
      }
   }

   private static boolean f(int var0) {
      switch(var0) {
      case 6:
      case 7:
      case 8:
      case 9:
      case 10:
      case 11:
      case 24:
      case 25:
      case 26:
      case 31:
      case 32:
      case 33:
      case 53:
      case 54:
      case 55:
         return true;
      case 12:
      case 13:
      case 14:
      case 15:
      case 16:
      case 17:
      case 18:
      case 19:
      case 20:
      case 21:
      case 22:
      case 23:
      case 27:
      case 28:
      case 29:
      case 30:
      case 34:
      case 35:
      case 36:
      case 37:
      case 38:
      case 39:
      case 40:
      case 41:
      case 42:
      case 43:
      case 44:
      case 45:
      case 46:
      case 47:
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      default:
         return false;
      }
   }

   static void a(zbp var0, double var1, double var3, double[] var5, int var6, double var7, double var9, boolean var11, boolean var12) {
      double var13 = var1;
      double var15 = var3;
      int var17 = zbuk.a(var5);
      double var18;
      double var20;
      if (var6 == 1) {
         var18 = var3;
         if (!var0.M()) {
            var13 = var0.D();
         } else {
            while(true) {
               if (var18 < var1 && var1 - var18 >= var5[0]) {
                  if ((zbuk.a(var9, var13) <= var5[0] || var13 == 0.0D) && (var9 - var3) / (var13 - var3) > 0.9523809523809523D && var13 != 0.0D) {
                     var13 = zbuk.a(var13 - var5[0], var17);
                  }
                  break;
               }

               var18 = zbuk.a(var18, var17);
               var13 = var18;
               var20 = var5[0];
               var18 = zbuk.a(var18, var20);
            }
         }
      } else if (var6 == 2) {
         var18 = var1;
         if (!var0.N()) {
            var15 = var0.z();
         } else {
            double var23;
            for(int var25 = 0; var18 <= var3 || var18 < var3 + var5[0]; var18 = var23) {
               var18 = zbuk.a(var18, var17);
               var15 = var18;
               double var21 = var5[0];
               ++var25;
               var23 = var1 + var21 * (double)var25;
            }

            if ((zbuk.a(var15, var7) <= var5[0] || var15 == 0.0D) && (var7 - var1) / (var15 - var1) > 0.9523809523809523D && var15 != 0.0D) {
               var15 = zbuk.a(var15 + var5[0], var17);
            }
         }
      } else {
         var18 = 0.0D;
         if (!var0.M()) {
            var13 = var0.D();
         } else {
            while(true) {
               if (var18 < var1 && var1 - var18 >= var5[0]) {
                  if ((zbuk.a(var9, var13) <= var5[0] || var13 == 0.0D) && (var9 - var3) / (var13 - var3) > 0.9523809523809523D && var13 != 0.0D) {
                     var13 = zbuk.a(var13 - var5[0], var17);
                  }
                  break;
               }

               var18 = zbuk.a(var18, var17);
               var13 = var18;
               var20 = var5[0];
               var18 = zbuk.a(var18, var20);
            }
         }

         var18 = 0.0D;
         if (!var0.N()) {
            var15 = var0.D();
         } else {
            while(true) {
               if (var18 > var3 && var18 >= var3 + var5[0]) {
                  if ((zbuk.a(var15, var7) <= var5[0] || var15 == 0.0D) && (var7 - var1) / (var15 - var1) > 0.9523809523809523D && var15 != 0.0D) {
                     var15 = zbuk.a(var15 + var5[0], var17);
                  }
                  break;
               }

               var18 = zbuk.a(var18, var17);
               var15 = var18;
               var20 = var5[0];
               var18 = zbuk.b(var18, var20);
            }
         }
      }

      var18 = var5[0];
      var20 = (var15 - var13) / var5[0];
      int var22 = d(var0.e().N()) ? 10 : 11;
      if (var0.e().aa()) {
         var22 = 13;
      } else if (var15 > 0.0D && var13 < 0.0D) {
         var22 = 12;
      }

      if (var20 >= (double)var22) {
         a(var5);
      } else {
         b(var5);
         if (var15 - var13 > 10.0D * var5[0]) {
            var5[0] = var18;
         }
      }

   }

   static void a(zbp var0, double var1, double var3, int var5, float var6, boolean var7, zbcq var8, boolean var9, boolean var10, boolean var11) {
      zig var12 = var0.e();
      ArrayList var13 = var0.l;
      if (var0.I() != 3) {
         if (var13.size() > 2) {
            double var14 = var1;
            if (var1 == var3 && var1 == 0.0D) {
               var0.d(1.0D);
               var1 = 1.0D;
               var14 = 1.0D;
               var0.f(0.0D);
               var9 = false;
               var10 = false;
            }

            if (var7 && var11) {
               boolean var18 = false;
               if (var5 == 8 || var5 == 16 || var12.N() == 20 || var12.N() == 11) {
                  var18 = true;
               }

               if (var18) {
                  if (var1 == 100.0D && var9) {
                     var0.d(100.0D);
                  }

                  if (var3 == -100.0D && var10) {
                     var0.f(-100.0D);
                  }
               }

               boolean var19 = true;
               double var20 = (Double)var0.l.get(var0.l.size() - 1);
               double var22 = (Double)var0.l.get(0);
               byte var27;
               if (var9 && var10) {
                  var27 = 3;
                  if (var20 == 0.0D) {
                     var27 = 2;
                  }

                  if (var22 == 0.0D) {
                     var27 = 1;
                  }
               } else if (!var9 && var10) {
                  var27 = 1;
               } else {
                  var27 = 2;
               }

               double var24 = var0.x();
               double[] var26 = new double[]{var24};
               a(var26, var0, var8, var6, var27, var20, var22, var14, var3, var9, var10, var18);
               var24 = var26[0];
               if (var13.size() >= 2) {
                  var0.d((Double)var13.get(0));
                  var0.f((Double)var13.get(var13.size() - 1));
                  var0.c(var24);
                  if (var0.P()) {
                     var0.e(var0.x() / 5.0D);
                  }
               }
            }

         }
      }
   }

   private static void a(double[] var0, zbp var1, zbcq var2, float var3, int var4, double var5, double var7, double var9, double var11, boolean var13, boolean var14, boolean var15) {
      zig var16 = var1.e();
      ArrayList var17 = var1.l;
      if (var1.I() != 3) {
         if (var17.size() > 2) {
            float var18 = 0.0F;
            var18 = var1.J().l();
            float var19 = var3 / (float)(var1.l.size() - 1);
            double var20;
            if (var19 / var18 > 9.0F && (l(var16) || !var13 || !var14)) {
               b(var0);
               if ((Double)var17.get(0) - (Double)var17.get(var17.size() - 1) > 11.0D * var0[0]) {
                  a(var0);
               } else {
                  var20 = var0[0];
                  b(var1, var4, var20, var5, var7, var17, var9, var11, var13, var14, var15);
               }
            } else if (var19 / var18 < 3.0F) {
               a(var0);
               var20 = var0[0];
               b(var1, var4, var20, var5, var7, var17, var9, var11, var13, var14, var15);
               a(var0, var1, var2, var3, var4, var5, var7, var9, var11, var13, var14, var15);
            }

         }
      }
   }

   private static void b(zbp var0, int var1, double var2, double var4, double var6, ArrayList var8, double var9, double var11, boolean var13, boolean var14, boolean var15) {
      zig var16 = var0.e();
      boolean var17 = l(var0.e());
      char var18 = com.aspose.cells.b.a.ze.a(com.aspose.cells.b.a.c.zc.a().c());
      var8.clear();
      double var19;
      int var21;
      double var22;
      if (var1 == 1) {
         var19 = var6;

         for(var21 = zbuk.g(var2); var19 >= var4 || var4 - var19 < var2; var19 -= var2) {
            var19 = zbuk.a(var19, var21);
            if (!var14 && var19 < var0.D()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.D());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }

         if (var14) {
            var22 = Double.MAX_VALUE;
            if (var8.size() > 0) {
               var22 = (Double)var8.get(var8.size() - 1);
            }

            if (var11 - var22 > var2 && var22 != 0.0D) {
               var22 += var2;
               if ((var11 - var6) / (var22 - var6) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var11 - var6) / (var22 - var6) > 0.9523809523809523D && var22 != 0.0D) {
               var19 = zbuk.a(var22 - var2, var21);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }
      } else if (var1 == 2) {
         var19 = var4;

         for(var21 = zbuk.g(var2); var19 <= var6 || var19 < var6 + var2; var19 += var2) {
            var19 = zbuk.a(var19, var21);
            if (!var13 && var19 > var0.z()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.z());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }

         if (var13) {
            var22 = -2.147483648E9D;
            if (var8.size() > 0) {
               var22 = (Double)var8.get(var8.size() - 1);
            }

            if (var22 - var9 > var2 && var22 != 0.0D) {
               var22 -= var2;
               if ((var9 - var4) / (var22 - var4) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var9 - var4) / (var22 - var4) > 0.9523809523809523D && var22 != 0.0D) {
               var19 = zbuk.a(var22 + var2, var21);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }

         Collections.reverse(var8);
      } else {
         var19 = 0.0D;

         for(var21 = zbuk.g(var2); var19 <= var6 || var19 - var6 < var2; var19 += var2) {
            var19 = zbuk.a(var19, var21);
            com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
         }

         if (var13) {
            var22 = -2.147483648E9D;
            if (var8.size() > 0) {
               var22 = (Double)var8.get(var8.size() - 1);
            }

            if (var22 - var9 > var2) {
               var22 -= var2;
               if ((var9 - var11) / (var22 - var11) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var9 - var11) / (var22 - var11) > 0.9523809523809523D) {
               var19 = zbuk.a(var22 + var2, var21);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }

         Collections.reverse(var8);

         for(var19 = 0.0D - var2; var19 >= var4 || var4 - var19 < var2; var19 -= var2) {
            var19 = zbuk.a(var19, var21);
            com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
         }

         if (var14) {
            var22 = Double.MAX_VALUE;
            if (var8.size() > 0) {
               var22 = (Double)var8.get(var8.size() - 1);
            }

            if (var11 - var22 > var2) {
               var22 += var2;
               if ((var11 - var9) / (var22 - var9) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var11 - var9) / (var22 - var9) > 0.9523809523809523D) {
               var19 = zbuk.a(var22 - var2, var21);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }
      }

      if (var8.size() >= 2) {
         if ((var15 || l(var16)) && (Double)var8.get(0) >= var9 + var2 && (Double)var8.get(0) != 0.0D && var13 && var8.size() > 3) {
            var8.remove(0);
         }

         if ((var15 || l(var16)) && (Double)var8.get(var8.size() - 1) <= var11 - var2 && (Double)var8.get(var8.size() - 1) != 0.0D && var14 && var8.size() > 3) {
            var8.remove(var8.size() - 1);
         }
      }

   }

   static void a(zn var0, zbp var1, ArrayList var2, com.aspose.cells.b.a.b.zp var3, int var4, zbcs var5, boolean var6) throws Exception {
      var2.clear();
      zig var7 = var1.e();
      int var8 = a(var5.i());
      boolean var16;
      boolean var17;
      int var29;
      zbcq var32;
      boolean var35;
      if (c(var4) && !var1.p) {
         double var26 = 0.0D;
         double var11 = 0.0D;
         double[] var13 = new double[]{var26};
         double[] var30 = new double[]{var11};
         c(var5.i(), var13, var30, var1);
         var26 = var13[0];
         var11 = var30[0];
         if (var4 == 12 && var26 == 0.0D && var11 == 0.0D) {
            var1.c(1.0D);
         }

         for(var29 = 0; var29 < var5.getCount(); ++var29) {
            var32 = var5.c(var29);
            double var40 = 0.0D;
            double var42 = 0.0D;
            zbcs var21 = new zbcs(var7);
            var21.a(var32);
            double[] var22 = new double[]{var40};
            double[] var23 = new double[]{var42};
            c(var21.i(), var22, var23, var1);
            var40 = var22[0];
            var42 = var23[0];
            if (var40 == 0.0D && var42 == 0.0D) {
               zjg var24 = var32.E();

               for(int var25 = 0; var25 < var24.getCount(); ++var25) {
                  var24.a(var25).a((double)(var25 + 1));
               }
            }
         }

         var35 = var1.N();
         var16 = var1.M();
         var13[0] = var26;
         var30[0] = var11;
         var17 = c(var5.i(), var13, var30, var1);
         var26 = var13[0];
         var11 = var30[0];
         a(var0, var1, var11, var26, var17, var2, var4, var3, true, var5.c(0));
      } else {
         zbcs var9 = new zbcs(var7);
         zbcs var10 = new zbcs(var7);
         new ArrayList();
         double var12 = 0.0D;
         if (var1.p) {
            Iterator var14 = var5.iterator();

            while(var14.hasNext()) {
               zbcq var15 = (zbcq)var14.next();
               if (var15.ah() == 60) {
                  var9.a(var15);
               } else {
                  var10.a(var15);
               }
            }

            double var27 = 0.0D;
            var16 = var1.N();
            var17 = var1.M();
            double[] var18 = new double[]{var27};
            double[] var19 = new double[]{var12};
            boolean var20 = c(var9.i(), var18, var19, var1);
            var27 = var18[0];
            var12 = var19[0];
            var12 = Math.ceil(var12);
            if ("valAx".equals(var1.U())) {
               a(var0, var1, var12, var27, var20, var2, 60, var3, true, var9.c(0));
               return;
            }
         } else {
            var10 = var5;
         }

         e(var1);
         if (var1.k() == 2) {
            a(var0, var1, var3, var4, var10, var6);
         } else {
            ArrayList var28;
            if (var1.g() == 0) {
               var28 = var7.z().c();
            } else {
               var28 = var7.z().d();
            }

            if (var28.size() > 0) {
               var35 = b(var28);

               int var34;
               for(var34 = 0; var34 < var28.size() && var34 < var8; ++var34) {
                  DateTime var36 = DateTime.getNow();
                  zfp var37 = (zfp)var28.get(var34);
                  if (var37.f() && var35) {
                     int var41 = zamo.a(var37.a().getClass());
                     switch(var41) {
                     case 3:
                     case 9:
                     case 14:
                     case 16:
                        var36 = zbuk.a(com.aspose.cells.b.a.ze.g(var37.a()), var7.X());
                        String var43 = zgc.a(var7.al(), var36, var37.c());
                        com.aspose.cells.b.a.a.ze.a(var2, (Object)var43);
                        break;
                     default:
                        com.aspose.cells.b.a.a.ze.a(var2, var37.a());
                     }
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var2, var37.a());
                  }
               }

               for(var34 = 0; var34 < var10.getCount(); ++var34) {
                  zbcq var38 = var10.c(var34);

                  for(int var39 = 0; var39 < var38.E().getCount(); ++var39) {
                     var38.E().b(var39).a((double)(var39 + 1));
                  }
               }
            } else {
               zfp var31;
               if (var4 == 44) {
                  for(var29 = 1; var29 <= var10.a(0).k().getCount(); ++var29) {
                     com.aspose.cells.b.a.a.ze.a(var2, (Object)com.aspose.cells.b.a.ze.g(var29));
                     var31 = new zfp((zfp)null, var29);
                     com.aspose.cells.b.a.a.ze.a(var28, (Object)var31);
                  }
               } else {
                  for(var29 = 1; var29 <= var8; ++var29) {
                     com.aspose.cells.b.a.a.ze.a(var2, (Object)com.aspose.cells.b.a.ze.g(var29));
                     var31 = new zfp((zfp)null, var29);
                     com.aspose.cells.b.a.a.ze.a(var28, (Object)var31);
                  }

                  if (var1.p) {
                     for(var29 = var8 + 1; (double)var29 <= var12; ++var29) {
                        com.aspose.cells.b.a.a.ze.a(var2, (Object)com.aspose.cells.b.a.ze.g(var29));
                        var31 = new zfp((zfp)null, var29);
                        com.aspose.cells.b.a.a.ze.a(var28, (Object)var31);
                     }
                  }

                  for(var29 = 0; var29 < var10.getCount(); ++var29) {
                     var32 = var10.c(var29);

                     for(int var33 = 0; var33 < var32.E().getCount(); ++var33) {
                        var32.E().b(var33).a((double)(var33 + 1));
                     }
                  }
               }
            }

            if (var1.p) {
               var1.f(1.0D);
               var1.d((double)var8 > var12 ? (double)var8 : var12);
            } else {
               var1.f(1.0D);
               var1.d((double)var8);
            }

            var1.c(1.0D);
            var1.e(var1.x() / 2.0D);
         }

      }
   }

   private static boolean b(ArrayList var0) {
      for(int var1 = 0; var1 < var0.size(); ++var1) {
         zfp var2 = (zfp)var0.get(var1);
         if (var2.a() == null) {
            return true;
         }

         int var3 = zamo.a(var2.a().getClass());
         if (var3 == 18) {
            return true;
         }
      }

      return false;
   }

   private static void e(zbp var0) {
      zig var1 = var0.e();
      ArrayList var2;
      ArrayList[] var3;
      if (var0.g() == 0) {
         var2 = var1.z().c();
         var3 = var1.z().e();
      } else {
         var2 = var1.z().d();
         var3 = var1.z().g();
      }

      if (var3 == null) {
         if (var2.size() != 0) {
            boolean var4 = a(var0.e(), var2, var0.k());
            if (var0.k() == 0) {
               if (var4) {
                  var0.d(2);
               }
            } else if (!var4 && var2.size() > 0) {
               var0.d(1);
            }

         }
      }
   }

   private static boolean a(zxx var0, String var1, Object var2) {
      if (var1 == null) {
         return false;
      } else {
         zafy var3 = var0.a(var1, false);
         int var4 = var0.a(var3, var2);
         return var4 == 3;
      }
   }

   static boolean a(zbp var0) {
      if (var0.k() == 1) {
         return false;
      } else {
         zig var1 = var0.e();
         ArrayList var2;
         ArrayList[] var3;
         if (var0.g() == 0) {
            var2 = var1.z().c();
            var3 = var1.z().e();
         } else {
            var2 = var1.z().d();
            var3 = var1.z().g();
         }

         if (var3 != null) {
            return false;
         } else {
            boolean var4 = a(var1, var2, var0.k());
            if (var0.k() == 0) {
               return var4;
            } else {
               return var4 || var2.size() <= 0;
            }
         }
      }
   }

   private static boolean a(zig var0, ArrayList var1, int var2) {
      if (var1.size() > 0) {
         zfp var3 = (zfp)var1.get(0);
         if (var3.f() && a(var0.al(), var3.c(), var3.a()) || var2 == 2) {
            boolean var4 = true;
            boolean var5 = true;

            for(int var6 = 0; var6 < var1.size(); ++var6) {
               zfp var7 = (zfp)var1.get(var6);
               if (!var7.g() && (var7.a() == null || !com.aspose.cells.b.a.zr.a(var7.a()).equals("#N/A"))) {
                  var5 = false;
                  boolean var8 = false;
                  if (var7.a() == null) {
                     var8 = true;
                  }

                  if (var7.a().equals("")) {
                     var8 = true;
                  }

                  if (var8) {
                     var4 = false;
                     break;
                  }

                  boolean var9 = false;
                  int var10 = zamo.a(var7.a().getClass());
                  switch(var10) {
                  case 3:
                  case 9:
                  case 14:
                  case 16:
                     var9 = true;
                  }

                  if (!var9) {
                     var4 = false;
                     break;
                  }

                  if (var2 == 0 && !var7.f() && !a(var0.al(), var7.c(), var7.a())) {
                     var4 = false;
                     break;
                  }
               }
            }

            if (var4 && !var5) {
               return true;
            }
         }
      }

      return false;
   }

   private static void a(zn var0, zbp var1, com.aspose.cells.b.a.b.zp var2, int var3, zbcs var4, boolean var5) throws Exception {
      zig var6 = var1.e();
      ArrayList var7 = var1.l;
      ArrayList var8;
      if (var1.g() == 0) {
         var8 = var6.z().c();
      } else {
         var8 = var6.z().d();
      }

      int var9 = a(var4.i());
      boolean var10 = false;
      if (var8.size() == 0) {
         var10 = true;
      }

      ArrayList var11 = new ArrayList();
      int var12;
      int var14;
      if (var8.size() > 0) {
         while(var8.size() > var9) {
            var8.remove(var8.size() - 1);
         }

         for(var12 = 0; var12 < var8.size(); ++var12) {
            zafr var13 = (zafr)var8.get(var12);
            if (var13.a() != null && com.aspose.cells.b.a.zr.a(var13.a()).equals("#N/A")) {
               var8.remove(var12);
               --var12;
            } else {
               var14 = a(var13.a(), var1.e().X());
               if (var14 >= 0) {
                  com.aspose.cells.b.a.a.ze.a(var11, (Object)var14);
               } else if (!var13.g()) {
                  var10 = true;
                  var11.clear();
                  var8.clear();
                  break;
               }
            }
         }
      }

      int var19;
      if (var10) {
         String var18 = "";
         if (var1.j() == 1) {
            var18 = "M/d/yyyy";
         } else if (var1.j() == 2) {
            var18 = "MMM-yy";
         } else {
            var18 = "yyyy";
         }

         for(var19 = 1; var19 <= var9; ++var19) {
            zfp var21 = new zfp((zfp)null, var19);
            var21.a(false);
            var21.a(var18);
            com.aspose.cells.b.a.a.ze.a(var8, (Object)var21);
            com.aspose.cells.b.a.a.ze.a(var11, (Object)var19);
         }
      }

      for(var12 = 0; var12 < var4.getCount(); ++var12) {
         zbcq var20 = var4.c(var12);

         for(var14 = 0; var14 < var8.size(); ++var14) {
            zje var15 = var20.E().b(var14);
            if (var15 != null) {
               zfp var16 = (zfp)var8.get(var14);
               int var17 = a(var16.a(), var1.e().X());
               var15.a((double)var17);
            }
         }
      }

      ArrayList var23 = new ArrayList();
      com.aspose.cells.b.a.a.ze.a(var23, (Collection)var11);
      Collections.sort(var23);
      if (var1.N()) {
         var1.d((double)zbr.a(var1.j(), (Integer)var23.get(var23.size() - 1), var6.X()));
      }

      if (var1.M()) {
         var1.f((double)zbr.a(var1.j(), (Integer)var23.get(0), var6.X()));
      }

      if (var1.r()) {
         var19 = a((List)var23, var6.X());
         var1.c(var19);
      }

      a(var0, var1, var2, var3, var5, var10);
      var19 = (int)var1.D();
      var14 = (int)var1.z();
      var7.clear();
      com.aspose.cells.b.a.a.ze.a(var7, (Object)var19);
      int var22 = zbr.a(var1.j(), var1.y(), (int)var1.x(), var19, var6.X());
      double var24 = (double)var19;
      if ((double)var19 + var1.x() == 60.0D && var22 == 61) {
         var22 = 60;
      }

      while(var14 - var22 >= 0) {
         com.aspose.cells.b.a.a.ze.a(var7, (Object)var22);
         var24 = (double)var22;
         var22 = zbr.a(var1.j(), var1.y(), (int)var1.x(), var22, var6.X());
         if (var24 + var1.x() == 60.0D && var22 == 61) {
            var22 = 60;
         }
      }

   }

   private static int a(List var0, boolean var1) {
      byte var2 = 3;
      byte var3 = 28;

      for(int var4 = 0; var4 < var0.size() - 1; ++var4) {
         DateTime var5 = zbr.a((double)(Integer)var0.get(var4), var1);
         DateTime var6 = zbr.a((double)(Integer)var0.get(var4 + 1), var1);
         if (com.aspose.cells.a.c.zk.b(var5.addDays((double)var3), var6)) {
            var2 = 1;
         } else if (com.aspose.cells.a.c.zk.b(var5.addYears(1), var6) && var2 == 3) {
            var2 = 2;
         }
      }

      return var2;
   }

   static int a(Object var0, boolean var1) throws Exception {
      short var2 = -10000;
      if (var0 == null) {
         return var2;
      } else {
         switch(zamo.a(var0.getClass())) {
         case 3:
         case 9:
         case 14:
            return com.aspose.cells.b.a.ze.f(var0);
         case 16:
            DateTime var3 = com.aspose.cells.b.a.ze.h(var0);
            return zbr.a(var3, var1);
         case 18:
            return zbuk.a(var0, var2);
         default:
            return zbuk.a(var0, var2);
         }
      }
   }

   private static void a(zn var0, zbp var1, com.aspose.cells.b.a.b.zp var2, int var3, boolean var4, boolean var5) {
      zig var6 = var1.e();
      float var7 = 0.0F;
      String var10 = zbr.a((zbp)var1, (Object)var1.z());
      com.aspose.cells.b.a.b.zt var11 = new com.aspose.cells.b.a.b.zt((float)var2.e(), (float)var2.f());
      boolean var12 = var1.J().j();
      com.aspose.cells.b.a.b.zs var13 = zbsq.b(var6.ap(), var10, 0, var1.J().a(), (com.aspose.cells.b.a.b.zt)var11, 1, 1);
      float var8;
      float var9;
      if (var4) {
         var9 = (float)var2.f();
         if (var12) {
            var8 = (float)var13.c();
         } else {
            var8 = (float)var13.c();
         }
      } else {
         var9 = (float)var2.e();
         if (var12) {
            var8 = (float)var13.b();
         } else if (var1.J().d() == 0) {
            var8 = (float)var13.b();
         } else if (var1.J().d() != 90 && var1.J().d() != -90) {
            var8 = (float)((double)var13.c() / Math.sin((double)Math.abs(var1.J().d()) * 3.141592653589793D / 180.0D));
         } else {
            var8 = (float)var13.c();
         }
      }

      int var15 = (int)var1.z();
      int var16 = (int)var1.D();
      int var17 = var1.j();
      int var14;
      if (!var1.f() && !var6.u()) {
         var14 = zbr.a(var17, var15, var16, var1.e().X());
         if (var14 == 0) {
            var14 = 1;
         }
      } else {
         var14 = zbr.a(var17, var15, var16, var1.e().X()) + 1;
      }

      int var18;
      int var19;
      if (var1.O() && var1.P()) {
         while(true) {
            if ((float)var14 * (var8 + var7) < var9) {
               var1.c(1.0D);
               var1.e(1.0D);
               var1.g(var1.j());
               var1.i(var1.j());
               return;
            }

            if (!var12 || var5) {
               break;
            }

            if (var1.J().d() != 0) {
               if (var1.J().d() == 45) {
                  var1.J().b(90);
                  var8 = (float)var13.c();
               }
               break;
            }

            var1.J().b(45);
            var8 = (float)((double)var13.c() / Math.sin((double)Math.abs(var1.J().d()) * 3.141592653589793D / 180.0D));
         }

         if (var12 && !var5 && var1.J().d() > 0) {
            var8 *= 2.0F;
         }

         var18 = (int)(var9 / (var8 + var7));
         var19 = var14 % var18 == 0 ? var14 / var18 : var14 / var18 + 1;
         if (var1.j() == 1) {
            if (var19 <= 2) {
               var1.c((double)var19);
               var1.e(1.0D);
               var1.g(var1.j());
               var1.i(var1.j());
            } else if (var19 > 2 && var19 <= 7) {
               var1.c(7.0D);
               var1.e(1.0D);
               var1.g(var1.j());
               var1.i(var1.j());
            } else if (var19 > 7 && var19 <= 14) {
               var1.c(14.0D);
               var1.e(7.0D);
               var1.g(var1.j());
               var1.i(var1.j());
            } else if (var19 > 14 && var19 <= 30) {
               var1.c(1.0D);
               var1.e(1.0D);
               var1.g(2);
               var1.i(2);
            } else if (var19 > 30 && var19 <= 360) {
               var1.c(var19 % 30 == 0 ? (double)(var19 / 30) : (double)(var19 / 30 + 1));
               var1.e((int)(var1.x() / 2.0D) == 0 ? 1.0D : (double)((int)(var1.x() / 2.0D)));
               var1.g(2);
               var1.i(2);
            } else {
               var1.c(var19 % 360 == 0 ? (double)(var19 / 360) : (double)(var19 / 360 + 1));
               var1.e((int)(var1.x() / 2.0D) == 0 ? 1.0D : (double)((int)(var1.x() / 2.0D)));
               var1.g(3);
               var1.i(3);
            }
         } else if (var1.j() == 2) {
            if (var19 < 12) {
               var1.c((double)var19);
               var1.e((int)(var1.x() / 2.0D) == 0 ? 1.0D : (double)((int)(var1.x() / 2.0D)));
               var1.g(2);
               var1.i(2);
            } else {
               var1.c(var19 % 12 == 0 ? (double)(var19 / 12) : (double)(var19 / 12 + 1));
               var1.e((int)(var1.x() / 2.0D) == 0 ? 1.0D : (double)((int)(var1.x() / 2.0D)));
               var1.g(3);
               var1.i(3);
            }
         } else {
            var1.c((double)var19);
            var1.e((int)(var1.x() / 2.0D) == 0 ? 1.0D : (double)((int)(var1.x() / 2.0D)));
            var1.g(3);
            var1.i(3);
         }
      } else if (var1.O() && !var1.P()) {
         var18 = zbuk.a((double)((float)((double)zbr.b(var1.C(), var15, var16, var1.e().X()) / var1.B())));
         if (!var1.f() && !var6.u()) {
            var14 = var18;
            if (var18 == 0) {
               var14 = 1;
            }
         } else {
            var14 = var18 + 1;
         }

         while(true) {
            if ((float)var14 * (var8 + var7) < var9) {
               var1.g(var1.C());
               var1.c(var1.B());
               return;
            }

            if (!var12 || var5) {
               break;
            }

            if (var1.J().d() != 0) {
               if (var1.J().d() == 45) {
                  var1.J().b(90);
                  var8 = (float)var13.c();
               }
               break;
            }

            var1.J().b(45);
            var8 = (float)((double)var13.c() / Math.sin((double)Math.abs(var1.J().d()) * 3.141592653589793D / 180.0D));
         }

         if (var12 && !var5 && var1.J().d() > 0) {
            var8 *= 2.0F;
         }

         var19 = (int)(var9 / (var8 + var7));
         int var20 = var14 % var19 == 0 ? var14 / var19 : var14 / var19 + 1;
         if (var1.j() == 1) {
            if (var20 <= 2) {
               if (var1.C() > var1.j()) {
                  var1.g(var1.C());
                  var1.c(var1.B());
               } else {
                  var1.g(var1.j());
                  var1.c((double)var20);
                  if (var1.x() < var1.B()) {
                     var1.c(var1.B());
                  }
               }
            } else if (var20 > 2 && var20 <= 7) {
               if (var1.C() > var1.j()) {
                  var1.g(var1.C());
                  var1.c(var1.B());
               } else {
                  var1.g(var1.j());
                  var1.c(7.0D);
                  if (var1.x() < var1.B()) {
                     var1.c(var1.B());
                  }
               }
            } else if (var20 > 7 && var20 <= 14) {
               if (var1.C() > var1.j()) {
                  var1.g(var1.C());
                  var1.c(var1.B());
               } else {
                  var1.g(var1.j());
                  var1.c(14.0D);
                  if (var1.x() < var1.B()) {
                     var1.c(var1.B());
                  }
               }
            } else if (var20 > 14 && var20 <= 30) {
               if (var1.C() == 3) {
                  var1.g(var1.C());
                  var1.c(var1.B());
               } else {
                  var1.g(2);
                  var1.c(1.0D);
                  if (var1.x() < var1.B() && var1.C() == 2) {
                     var1.c(var1.B());
                  }
               }
            } else if (var20 > 30 && var20 <= 360) {
               if (var1.C() == 3) {
                  var1.g(var1.C());
                  var1.c(var1.B());
               } else {
                  var1.g(2);
                  var1.c(var20 % 30 == 0 ? (double)(var20 / 30) : (double)(var20 / 30 + 1));
                  if (var1.x() < var1.B() && var1.C() == 2) {
                     var1.c(var1.B());
                  }
               }
            } else {
               var1.c(var20 % 360 == 0 ? (double)(var20 / 360) : (double)(var20 / 360 + 1));
               var1.g(3);
               if (var1.x() < var1.B() && var1.C() == 3) {
                  var1.c(var1.B());
               }
            }
         } else if (var1.j() == 2) {
            if (var20 < 12) {
               if (var1.C() == 2) {
                  if (var1.B() <= (double)var20) {
                     var1.c((double)var20);
                     var1.g(2);
                  } else {
                     var1.c(var1.B());
                     var1.g(2);
                  }
               } else {
                  var1.c(var1.B());
                  var1.g(3);
               }
            } else {
               var20 = var20 % 12 == 0 ? var20 / 12 : var20 / 12 + 1;
               if (var1.C() == 2) {
                  var1.c((double)var20);
                  var1.g(3);
               } else if (var1.B() <= (double)var20) {
                  var1.c((double)var20);
                  var1.g(3);
               } else {
                  var1.c(var1.B());
                  var1.g(3);
               }
            }
         } else {
            if (var1.B() <= (double)var20) {
               var1.c((double)var20);
            } else {
               var1.c(var1.B());
            }

            var1.g(3);
         }
      } else if (!var1.O() && var1.P()) {
         var1.e((int)(var1.x() / 2.0D) == 0 ? 1.0D : (double)((int)(var1.x() / 2.0D)));
         var1.i(var1.y());
         if (var12 && !var5) {
            var18 = zbuk.a((double)((float)((double)zbr.b(var1.y(), var15, var16, var1.e().X()) / var1.x())));
            if (!var1.f() && !var6.u()) {
               var14 = var18;
               if (var18 == 0) {
                  var14 = 1;
               }
            } else {
               var14 = var18 + 1;
            }

            while((float)var14 * (var8 + var7) > var9) {
               if (var1.J().d() == 0) {
                  var1.J().b(45);
                  var8 = (float)((double)var13.c() / Math.sin((double)Math.abs(var1.J().d()) * 3.141592653589793D / 180.0D));
               } else if (var1.J().d() == 45) {
                  var1.J().b(90);
                  break;
               }
            }
         }
      } else if (var12 && !var5) {
         var18 = zbuk.a((double)((float)((double)zbr.b(var1.y(), var15, var16, var1.e().X()) / var1.x())));
         if (!var1.f() && !var6.u()) {
            var14 = var18;
            if (var18 == 0) {
               var14 = 1;
            }
         } else {
            var14 = var18 + 1;
         }

         while((float)var14 * (var8 + var7) > var9) {
            if (var1.J().d() == 0) {
               var1.J().b(45);
               var8 = (float)((double)var13.c() / Math.sin((double)Math.abs(var1.J().d()) * 3.141592653589793D / 180.0D));
            } else if (var1.J().d() == 45) {
               var1.J().b(90);
               break;
            }
         }
      }

   }

   static ArrayList a(ArrayList var0, boolean var1) throws Exception {
      ArrayList var2 = new ArrayList();

      for(int var3 = 0; var3 < var0.size(); ++var3) {
         int var4 = a(((zafr)var0.get(var3)).a(), var1);
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
      }

      return var2;
   }

   static void a(zn var0, zbp var1, double var2, double var4, ArrayList var6, int var7, com.aspose.cells.b.a.b.zp var8, boolean var9, zbcq var10) {
      double var11 = var2;
      double var13 = var4;
      zig var15 = var1.e();
      if (var2 == var4 && var2 == 0.0D) {
         var1.d(10.0D);
         var2 = 10.0D;
         var11 = 10.0D;
         var1.f(1.0D);
      }

      boolean var16 = var1.N();
      boolean var17 = var1.M();
      double var18 = 0.0D;
      byte var20 = 1;
      boolean var21 = var10.ap();
      if (var21) {
         if (var2 == 100.0D && var1.N()) {
            var1.d(100.0D);
         }

         if (var4 >= 1.0D && var1.M()) {
            var1.f(1.0D);
         }
      }

      double var22 = 0.0D;
      double var24 = 0.0D;
      double[] var26 = new double[]{var22};
      double[] var27 = new double[]{var24};
      double[] var28 = new double[]{var4};
      double[] var29 = new double[]{var2};
      double[] var30 = new double[]{var18};
      int[] var31 = new int[]{var20};
      a(var26, var27, var28, var29, var30, var31, var1, var9);
      var22 = var26[0];
      var24 = var27[0];
      var4 = var28[0];
      var2 = var29[0];
      var18 = var30[0];
      int var34 = var31[0];
      c(var1, var34, var18, var24, var22, var6, var11, var13, var16, var17, var21);
      int var32 = b(var0, var1, var9, var10, var8);
      boolean var33 = false;
      int var35;
      if (var1.e().aa()) {
         if (var9) {
            var35 = (int)var1.e().S().g();
         } else {
            var35 = (int)var1.e().S().i();
         }
      } else if (var9) {
         var35 = var8.e();
      } else {
         var35 = var8.f();
      }

      while(var1.O() && var6.size() > 3 && var32 > var35 && var35 != 0) {
         ++var18;
         c(var1, var34, var18, var24, var22, var6, var11, var13, var16, var17, var21);
         var32 = b(var0, var1, var9, var10, var8);
      }

      if (var6.size() >= 2) {
         if (var16) {
            var1.d(var1.h((Double)var6.get(0)));
         }

         if (var17) {
            var1.f(var1.h((Double)var6.get(var6.size() - 1)));
         }

         if (var1.O()) {
            var1.c(var1.h(var18));
         }

         if (var1.P()) {
            var1.e(var1.x());
         }
      }

   }

   private static void a(double[] var0, double[] var1, double[] var2, double[] var3, double[] var4, int[] var5, zbp var6, boolean var7) {
      var4[0] = 1.0D;
      double var8;
      double var10;
      if (var6.O()) {
         var8 = b(var2[0]);
         var10 = a(var3[0]);
         var1[0] = var8;
         var0[0] = var10;
         if (var6.N() && var6.M()) {
            var5[0] = 3;
            if (var8 >= 0.0D && var10 >= 0.0D) {
               var6.f(var6.h(0.0D));
               var5[0] = 2;
               var1[0] = 0.0D;
            } else {
               var6.f(var6.h(var8));
               var5[0] = 2;
               var1[0] = var8;
            }
         } else if (!var6.N() && var6.M()) {
            var5[0] = 1;
            var0[0] = var6.g(var6.z());
            var3[0] = var0[0];
         } else if (var6.N() && !var6.M()) {
            var5[0] = 2;
            var1[0] = var6.g(var6.D());
            var2[0] = var1[0];
         } else {
            var5[0] = 2;
            var1[0] = var6.g(var6.D());
            var0[0] = var6.g(var6.z());
            var2[0] = var6.g(var6.D());
            var3[0] = var6.g(var6.z());
         }
      } else {
         var4[0] = var6.g(var6.x());
         var8 = (double)((int)var2[0]);
         var10 = (double)((int)var3[0]) + var4[0];
         var1[0] = var8;
         var0[0] = var10;
         if (var6.N() && var6.M()) {
            var5[0] = 3;
            if (var8 >= 0.0D && var10 >= 0.0D) {
               var6.f(var6.h(0.0D));
               var5[0] = 2;
               var1[0] = 0.0D;
            } else {
               var6.f(var6.h(var8));
               var5[0] = 2;
               var1[0] = var8;
            }
         } else if (!var6.N() && var6.M()) {
            var5[0] = 1;
            var0[0] = var6.g(var6.z());
            var3[0] = var0[0];
         } else if (var6.N() && !var6.M()) {
            var5[0] = 2;
            var1[0] = var6.g(var6.D());
            var2[0] = var1[0];
         } else {
            var5[0] = 2;
            var1[0] = var6.g(var6.D());
            var0[0] = var6.g(var6.z());
            var2[0] = var6.g(var6.D());
            var3[0] = var6.g(var6.z());
         }
      }

   }

   private static void c(zbp var0, int var1, double var2, double var4, double var6, ArrayList var8, double var9, double var11, boolean var13, boolean var14, boolean var15) {
      var8.clear();
      double var16;
      if (var1 == 1) {
         for(var16 = var6; var16 >= var4 || zbuk.a(var4, var16) < var2; var16 -= var2) {
            if (!var0.M() && var16 < var0.W()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.W());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var16);
            }
         }
      } else if (var1 == 2) {
         for(var16 = var4; var16 <= var6 || var16 < var6 + var2; var16 += var2) {
            if (!var0.N() && var16 > var0.V()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.V());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var16);
            }
         }

         Collections.reverse(var8);
      } else {
         for(var16 = 0.0D; var16 <= var6 || zbuk.a(var16, var6) < var2; var16 += var2) {
            if (!var0.N() && var16 > var0.V()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.V());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var16);
            }
         }

         Collections.reverse(var8);

         for(var16 = 0.0D - var2; var16 >= var4 || zbuk.a(var4, var16) < var2; var16 -= var2) {
            if (!var0.M() && var16 < var0.W()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.W());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var16);
            }
         }
      }

   }

   private static int b(zn var0, zbp var1, boolean var2, zbcq var3, com.aspose.cells.b.a.b.zp var4) {
      if (var1.I() == 3) {
         return 0;
      } else {
         zig var5 = var1.e();
         zbtk var6 = var1.J();
         zje var7 = var3.E().b(0);
         String var8 = var7.z();
         boolean var9 = var7.A();
         boolean var10 = false;
         if (var6.h() && var7 != null) {
            var10 = true;
         }

         int var11 = 0;

         for(int var12 = 0; var12 < var1.l.size(); ++var12) {
            double var13 = var1.h((Double)var1.l.get(var12));
            if (var3.ap()) {
               var13 /= 100.0D;
               var8 = "0%";
            }

            String var15 = "";
            if (var10) {
               var15 = zpw.a(var5.al(), var13, var8, var9);
            } else {
               var15 = zbr.a((zbp)var1, (Object)var13);
            }

            com.aspose.cells.b.a.b.zs var16 = new com.aspose.cells.b.a.b.zs(var4.e(), var4.f());
            com.aspose.cells.b.a.b.zs var17 = zbsq.b(var1.e().ap(), var15, var6.d(), var6.a(), (com.aspose.cells.b.a.b.zs)var16, 1, 1);
            if (var2) {
               if (var12 != 0 && var12 != var1.l.size() - 1) {
                  var11 += var17.b();
               } else {
                  var11 += var17.b() / 2;
               }
            } else if (var12 != 0 && var12 != var1.l.size() - 1) {
               var11 += var17.c();
            } else {
               var11 += var17.c() / 2;
            }

            if (var12 != 0 && var12 != var1.l.size() - 1) {
               var11 -= 2;
            } else {
               --var11;
            }
         }

         return (int)((double)var11 + 0.5D);
      }
   }

   private static double a(double var0) {
      boolean var2 = true;
      if (var0 < 0.0D) {
         var2 = false;
      }

      var0 = Math.abs(var0);
      double var3;
      if (var2) {
         var3 = (double)zbuk.b(var0);
         if (var3 != var0) {
            ++var3;
         }

         return var3;
      } else {
         var3 = (double)zbuk.b(var0);
         return -var3;
      }
   }

   private static double b(double var0) {
      boolean var2 = true;
      if (var0 < 0.0D) {
         var2 = false;
      }

      var0 = Math.abs(var0);
      double var3;
      if (!var2) {
         var3 = (double)zbuk.b(var0);
         if (var3 != var0) {
            ++var3;
         }

         return -var3;
      } else {
         var3 = (double)zbuk.b(var0);
         return var3;
      }
   }

   private static boolean m(zig var0) {
      int var1;
      zahv var2;
      for(var1 = 0; var1 < var0.A().getCount(); ++var1) {
         var2 = var0.A().a(var1);
         if (var2.m() == 57 || var2.m() == 59 || var2.m() == 58) {
            return false;
         }
      }

      for(var1 = 0; var1 < var0.A().getCount(); ++var1) {
         var2 = var0.A().a(var1);
         if (var2.j()) {
            return true;
         }
      }

      return false;
   }

   private static void a(zafo var0, zafo var1) {
      if (!var0.q()) {
         var0.a(var1.f());
         var0.d(var1.k());
         var0.e(var1.r());
         if (!var1.r()) {
            var0.c(var1.j());
         }

         var0.g(var1.y());
         var0.i(var1.C());
         var0.i(var1.O());
         if (!var1.O()) {
            var0.c(var1.x());
         }

         var0.j(var1.P());
         if (!var1.P()) {
            var0.e(var1.B());
         }

         var0.h(var1.N());
         if (!var1.N()) {
            var0.d(var1.z());
         }

         var0.g(var1.M());
         if (!var1.M()) {
            var0.f(var1.D());
         }

      }
   }

   private static void n(zig var0) {
      int var1;
      zafr var2;
      zfp var3;
      for(var1 = 0; var1 < var0.z().d().size(); ++var1) {
         var2 = (zafr)var0.z().d().get(var1);
         var3 = new zfp((zfp)null, var2.a());
         var3.a(var2.b());
         var3.b(var2.f());
         var3.c(var2.g());
         var3.a(var2.c());
         com.aspose.cells.b.a.a.ze.a(var0.z().f(), (Object)var3);
      }

      var0.z().d().clear();

      for(var1 = 0; var1 < var0.z().c().size(); ++var1) {
         var2 = (zafr)var0.z().c().get(var1);
         var3 = new zfp((zfp)null, var2.a());
         var3.a(var2.b());
         var3.b(var2.f());
         var3.c(var2.g());
         var3.a(var2.c());
         com.aspose.cells.b.a.a.ze.a(var0.z().d(), (Object)var3);
      }

   }

   static ArrayList[] a(zafs var0) {
      ArrayList[] var1 = null;
      int var2 = c(var0);
      if (var2 > 1) {
         var1 = new ArrayList[var2 - 1];

         for(int var3 = 0; var3 < var2 - 1; ++var3) {
            var1[var3] = new ArrayList();
            a(var0, var3, 0, var1[var3]);
         }
      }

      return var1;
   }

   static ArrayList b(zafs var0) {
      ArrayList var1 = null;
      var1 = new ArrayList();
      int var2 = c(var0);
      a(var0, var2 - 1, 0, var1);
      return var1;
   }

   private static int c(zafs var0) {
      if (var0.getCount() == 0) {
         return 0;
      } else {
         zafr var1 = var0.a(0);

         int var2;
         for(var2 = 1; var1.d().getCount() > 0; var1 = var1.d().a(0)) {
            ++var2;
         }

         return var2;
      }
   }

   private static void a(zafs var0, int var1, int var2, ArrayList var3) {
      int var4;
      zafr var5;
      if (var1 == var2) {
         for(var4 = 0; var4 < var0.getCount(); ++var4) {
            var5 = var0.a(var4);
            com.aspose.cells.b.a.a.ze.a(var3, (Object)var5);
         }
      } else {
         for(var4 = 0; var4 < var0.getCount(); ++var4) {
            var5 = var0.a(var4);
            a(var5.d(), var1, var2 + 1, var3);
         }
      }

   }
}
